feat: use oauth provider

This commit is contained in:
2025-05-24 20:59:15 +02:00
parent c6c03e9cb6
commit 87916f96fd
3 changed files with 73 additions and 1 deletions

View 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);