Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use auth0 #599

Merged
merged 4 commits into from
Feb 6, 2024
Merged

Use auth0 #599

merged 4 commits into from
Feb 6, 2024

Conversation

argaen
Copy link
Contributor

@argaen argaen commented Feb 6, 2024

Move to using auth0 for managing users. Good because we can remove the authorize and refresh endpoints from Stocker and interact directly with auth0 using the auth0-react library.

Note we are doing some unofficial stuff to extract the Google access_token from Auth0 (maffin-io/maffin-blog#259)


import { Auth0Provider } from '@auth0/auth0-react';

export default Auth0Provider;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need use client so the Auth0Provider works but we need to extract it so we can set metadata in the root page.

@argaen argaen force-pushed the use_auth0 branch 5 times, most recently from 1b92a01 to 6dbf074 Compare February 6, 2024 14:41
@argaen argaen merged commit 7d23bc8 into master Feb 6, 2024
2 checks passed
@argaen argaen deleted the use_auth0 branch February 6, 2024 14:51
@@ -37,7 +42,17 @@ export default function RootLayout({
<html lang="en">
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
{children}
<Auth0Provider
domain={`maffin${isProd() ? '' : '-dev'}.eu.auth0.com`}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have different tenants for development and production

{children}
<Auth0Provider
domain={`maffin${isProd() ? '' : '-dev'}.eu.auth0.com`}
clientId={isProd() ? 'cEXnN96kEP3ER2EDJjmjRW0u2MEFBUKK' : 'mMmnR4NbQOnim9B8QZfe9wfFuaKb8rwW'}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each app in Auth0 has a different clientId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant