-
Notifications
You must be signed in to change notification settings - Fork 158
Migration of sample app to Nexjs SDK v4 #180
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
base: main
Are you sure you want to change the base?
Conversation
# Your Auth0 tenant domain | ||
AUTH0_DOMAIN='YOUR_AUTH0_DOMAIN.auth0.com' | ||
# The base url of your application | ||
APP_BASE_URL='http://localhost:3000' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the order, so we simplify the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order isnt maintained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move updating nextjs to v14 or 15 in another PR?
"@babel/preset-typescript" | ||
], | ||
"plugins": [] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this neccessary to update the SDK?
|
||
If you do not wish to use an API or observe the API call working, you should not specify the `AUTH0_AUDIENCE` and `AUTH0_SCOPE` values in the next steps. | ||
If you do not wish to use an API or observe the API call working, you should not specify the `AUTH0_AUDIENCE` value in the next steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AUTH0_AUDIENCE?
|
||
### Configure credentials | ||
|
||
The project needs to be configured with your Auth0 Domain, Client ID and Client Secret for the authentication flow to work. | ||
|
||
To do this, first copy `.env.local.example` into a new file in the same folder called `.env.local`, and replace the values with your own Auth0 application credentials (see more info about [loading environmental variables in Next.js](https://nextjs.org/docs/basic-features/environment-variables)): | ||
To do this, first copy `.env.local.example` into a new file in the same folder called `.env.local`, and replace the values with your own Auth0 application credentials: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this link (https://nextjs.org/docs/basic-features/environment-variables) no longer relevant?
import initFontAwesome from '../utils/initFontAwesome'; | ||
|
||
// Initialize FontAwesome icons | ||
initFontAwesome(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this neccessary for updating our SDK?
const { isAuthenticated, user, guardComponent } = useAuthGuard(); | ||
|
||
// If not authenticated or loading, show guard component | ||
if (!isAuthenticated) return guardComponent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think introducing useAuthGuard here causes unneccesary complications in the diff.
window.location.href = '/auth/login'; | ||
} | ||
guardComponent = <Loading />; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think guardComponent is not the best idea in the sense that it isnt clear what it actually is where used.
If customers want that, they can, but let's refrain from adding this complexity in our sample but stay explicit.
transformIgnorePatterns: [ | ||
"/node_modules/(?!highlight\\.js)" | ||
] | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this ?
authorizationParameters: { | ||
scope: "openid profile email offline_access read:shows", | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have this ts file, and the js file?
Migration of sample app to Nexjs SDK v4