feat: use oauth provider
This commit is contained in:
33
web/src/context/oauth/index.ts
Normal file
33
web/src/context/oauth/index.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { createContext, useContext } from "react";
|
||||
|
||||
interface OAuthContextValues {
|
||||
active: boolean;
|
||||
clientID: string;
|
||||
redirectURI: string;
|
||||
scope: string[];
|
||||
state: string;
|
||||
nonce: string;
|
||||
setActive: (state: boolean) => void;
|
||||
setClientID: (id: string) => void;
|
||||
setRedirectURI: (uri: string) => void;
|
||||
setScope: (scopes: string[]) => void;
|
||||
setState: (state: string) => void;
|
||||
setNonce: (nonce: string) => void;
|
||||
}
|
||||
|
||||
export const OAuthContext = createContext<OAuthContextValues>({
|
||||
active: false,
|
||||
clientID: "",
|
||||
redirectURI: "",
|
||||
scope: [],
|
||||
state: "",
|
||||
nonce: "",
|
||||
setActive: () => {},
|
||||
setClientID: () => {},
|
||||
setRedirectURI: () => {},
|
||||
setScope: () => {},
|
||||
setState: () => {},
|
||||
setNonce: () => {},
|
||||
});
|
||||
|
||||
export const useOAuthContext = () => useContext(OAuthContext);
|
||||
Reference in New Issue
Block a user