-
Notifications
You must be signed in to change notification settings - Fork 460
Chore/update remix auth GitHub #944
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
Changes from all commits
95b8a0d
84071d8
757531d
c82ac31
85233ae
bbacdeb
6db36d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,9 @@ | ||
| import { createCookieSessionStorage } from 'react-router' | ||
| // import { createCookieSessionStorage } from 'react-router' | ||
| import { type ProviderName } from './connections.tsx' | ||
| import { GitHubProvider } from './providers/github.server.ts' | ||
| import { type AuthProvider } from './providers/provider.ts' | ||
| import { type Timings } from './timing.server.ts' | ||
|
|
||
| export const connectionSessionStorage = createCookieSessionStorage({ | ||
| cookie: { | ||
| name: 'en_connection', | ||
| sameSite: 'lax', // CSRF protection is advised if changing to 'none' | ||
| path: '/', | ||
| httpOnly: true, | ||
| maxAge: 60 * 10, // 10 minutes | ||
| secrets: process.env.SESSION_SECRET.split(','), | ||
| secure: process.env.NODE_ENV === 'production', | ||
| }, | ||
| }) | ||
|
|
||
|
Comment on lines
-7
to
-18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused why changing this was necessary because it looks like we've now lost the ability to display errors as the user goes between different pages in the OAuth flow. And I don't think that this change was necessary for upgrading to Remix auth. Can you help me understand why this change was made? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is no needed anymore since Remix Auth doesn't receive a session storage instance anymore, instead the strategy uses Then after the user is back in the app from GitHub it you need to save the data in your session storage yourself, AFAIK you already did this anyway so there's no change in that part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also related to error handling, now the strategies always throw an error, so you handle them with a try/catch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great to know! Thanks! |
||
| export const providers: Record<ProviderName, AuthProvider> = { | ||
| github: new GitHubProvider(), | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 had to change from "error" to

nullbecause the test was in timeout, stuck in theawait response.body.cancel()call inside thearcticlibrary. Cf. screenshots.