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

Save and handle post login redirect #29

Merged

Conversation

kate-shine
Copy link
Contributor

squashed commits from #25 and rebased on main

obsoletes #25 #28

@kate-shine
Copy link
Contributor Author

That was a really weird rebase O.o Worked well after squashing, but before that, it was really messy for some reason

@kate-shine kate-shine force-pushed the shine/save_and_handle_post_login_redirect branch from 4dd25a2 to 22fa180 Compare January 25, 2024 15:13
@kate-shine kate-shine marked this pull request as ready for review January 25, 2024 15:26
@@ -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 }
Copy link
Owner

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.

Copy link
Owner

@ctron ctron left a 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
Copy link
Owner

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
Copy link
Owner

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!

Copy link
Contributor Author

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 :)

@ctron ctron merged commit 2f8f262 into ctron:main Jan 26, 2024
3 checks passed
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.

3 participants