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

Cleanup things before the next release (0.10) #30

Merged
merged 24 commits into from
Jan 26, 2024
Merged

Conversation

ctron
Copy link
Owner

@ctron ctron commented Jan 26, 2024

No description provided.

Copy link
Contributor

@kate-shine kate-shine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just small suggestions ^_^


```toml
yew-oauth2 = { version = "0.9", features = ["router"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering, since the api is changing already anyway - coming at this as a yew beginner, this was a slightly confusing part, because I didn't realize that yew-nested-router and yew-router are mutually incompatible. Wouldn't naming this feature nested-router be more descriptive?

@@ -114,6 +125,10 @@ pub struct LogoutOptions {
}

impl LogoutOptions {
pub fn new() -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooof, didn't notice this in previous PR, that would complicate things a lot :D

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't, what I mean is that I missed absence of this constructor in the PR introducing non_exhaustive.

But right, it was still possible to create it with Default trait.

pub const STORAGE_KEY_CSRF_TOKEN: &str = "ctron/oauth2/csrfToken";
pub const STORAGE_KEY_LOGIN_STATE: &str = "ctron/oauth2/loginState";
pub const STORAGE_KEY_REDIRECT_URL: &str = "ctron/oauth2/redirectUrl";
pub const STORAGE_KEY_POST_LOGIN_URL: &str = "ctron/oauth2/postLoginUrl";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to make this specific const private, it might be a good idea to expose some method to get it, if user wants to for example provide a "redirect back" link from landing page.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to hide that internal state as far away as possible … would it work better to have some struct/fn which returns the actual data?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I mean by "expose some method to get it", yep :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I exposed this as the LoginState.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks amazing :)

@ctron ctron merged commit a6d0454 into main Jan 26, 2024
3 checks passed
@ctron ctron deleted the feature/cleanups_1 branch January 26, 2024 15:23
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.

2 participants