-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add signUpPaths configuration #123
Conversation
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.
Just have one question regarding getScreenHint
.
src/session.ts
Outdated
if (!Array.isArray(signUpPaths)) { | ||
return signUpPaths.includes(pathname) ? 'sign-up' : 'sign-in'; | ||
} | ||
|
||
const screenHintPaths: string[] = signUpPaths.filter((pathGlob) => { | ||
const pathRegex = getMiddlewareAuthPathRegex(pathGlob); | ||
return pathRegex.exec(pathname); | ||
}); |
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.
Is there a reason we pass the paths through getMiddlewareAuthPathRegex
if signUpPaths
is an array, but not if it's a single value? Could a single value also be a path glob?
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.
That's an excellent point!
Fixes #121
Adds
signUpPaths
to middleware configuration, which allows you to specify which paths should show the "sign up" screen hint over the default "sign in".