-
Notifications
You must be signed in to change notification settings - Fork 17
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
Save and handle post login redirect #29
Save and handle post login redirect #29
Conversation
That was a really weird rebase O.o Worked well after squashing, but before that, it was really messy for some reason |
4dd25a2
to
22fa180
Compare
@@ -33,7 +33,7 @@ web-sys = { version = "0.3", features = [ | |||
] } | |||
|
|||
openidconnect = { version = "3.0", optional = true } | |||
yew-nested-router = { version = ">=0.5, <0.7", optional = true } | |||
yew-nested-router = { version = ">=0.6.3, <0.7", optional = true } |
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 guess it's time to bring this back to just 0.6.3
. But I can do this post-merge.
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.
This is awesome, and I learned something new. Thanks for the PR!
self | ||
} | ||
|
||
/// Use `yew-nested-route` history api for post-login redirect callback |
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.
Typo
@@ -362,6 +393,24 @@ where | |||
} | |||
} | |||
|
|||
fn post_login_redirect(&self) -> Result<(), OAuth2Error> { | |||
let config = self.config.as_ref().ok_or(OAuth2Error::NotInitialized)?; | |||
let Some(redirect_callback) = config |
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.
If didn't know about let-else so far. Cool!
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.
It's new-ish and super convenient for return early pattern :)
squashed commits from #25 and rebased on main
obsoletes #25 #28