-
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
Cleanup things before the next release (0.10) #30
Conversation
Aside from a bunch of cleanups, this also makes the main configurations non-exhaustive, in order to be prepared for future extensions. BREAKING-CHANGE: In addition to the other configuration/option struct, this also makes the main configuration non-exhaustive. So it is no longer possible to directly create a new struct, but use the "new" function instead and modify the struct using the `with_*` functions.
BREAKING-CHANGE: All hooks are part of the `crate::hooks` module now. This legacy re-export was removed.
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.
lgtm, just small suggestions ^_^
|
||
```toml | ||
yew-oauth2 = { version = "0.9", features = ["router"] } |
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 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 { |
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.
Ooof, didn't notice this in previous PR, that would complicate things a lot :D
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.
Does it?
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 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"; |
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 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.
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 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?
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 what I mean by "expose some method to get it", yep :)
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 exposed this as the LoginState
.
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 looks amazing :)
BREAKING-CHANGE: The feature named "router" got renamed to "nested-router"
No description provided.