Skip to content

Commit

Permalink
ar(temp) auth stuff messy
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Jul 13, 2024
1 parent a652445 commit eeec385
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/auth/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const providers = [
{ id: 'github', name: 'GitHub', type: 'oidc' },
{ id: 'google', name: 'Google', type: 'oidc' },
{ id: 'apple', name: 'Apple', type: 'oidc' },
{ id: 'facebook', name: 'Facebook', type: 'oidc' }
{ id: 'facebook', name: 'Facebook', type: 'oidc' },
];

const methods = {
Expand Down
15 changes: 7 additions & 8 deletions lib/state/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function RootProviders({ children }: { children: React.ReactNode }) {
const [authState, setAuthState] = useState<IAuthContext>({ ...authContext });
const [globalState, setGlobalState] = useState<IGlobalContext>({ ...globalContext });
const init = useRef(false);
const base = process.env.NEXT_PUBLIC_NEXUS_BASE_PATH || '';

useEffect(() => {
if (!init.current && authContext && !authState?.setter) {
Expand All @@ -27,13 +26,13 @@ export function RootProviders({ children }: { children: React.ReactNode }) {
if (!authState?.initd) return;

return (
<AuthContext.Provider value={authState}>
<GlobalContext.Provider value={globalState}>
<Globals theme={globalState?.theme || 'dark'}>
<main className="min-h-screen">{children}</main>
</Globals>
</GlobalContext.Provider>
</AuthContext.Provider>
<AuthContext.Provider value={authState}>
<GlobalContext.Provider value={globalState}>
<Globals theme={globalState?.theme || 'dark'}>
<main className="min-h-screen">{children}</main>
</Globals>
</GlobalContext.Provider>
</AuthContext.Provider>
);
}

Expand Down

0 comments on commit eeec385

Please sign in to comment.