Skip to content

Commit 72037dc

Browse files
kate-shinectron
authored andcommitted
feat: make setters nicer to use
1 parent cdd734d commit 72037dc

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/config.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,23 @@ pub mod openid {
4949
}
5050

5151
/// Set an override for the URL for ending the session.
52-
pub fn with_end_session_url(mut self, end_session_url: impl Into<Option<String>>) -> Self {
53-
self.end_session_url = end_session_url.into();
52+
pub fn with_end_session_url(mut self, end_session_url: impl Into<String>) -> Self {
53+
self.end_session_url = Some(end_session_url.into());
5454
self
5555
}
5656

5757
/// Set the URL the issuer should redirect to after the logout
58-
pub fn with_after_logout_url(
59-
mut self,
60-
after_logout_url: impl Into<Option<String>>,
61-
) -> Self {
62-
self.after_logout_url = after_logout_url.into();
58+
pub fn with_after_logout_url(mut self, after_logout_url: impl Into<String>) -> Self {
59+
self.after_logout_url = Some(after_logout_url.into());
6360
self
6461
}
6562

6663
/// Set the name of the post logout redirect query parameter
6764
pub fn with_post_logout_redirect_name(
6865
mut self,
69-
post_logout_redirect_name: impl Into<Option<String>>,
66+
post_logout_redirect_name: impl Into<String>,
7067
) -> Self {
71-
self.post_logout_redirect_name = post_logout_redirect_name.into();
68+
self.post_logout_redirect_name = Some(post_logout_redirect_name.into());
7269
self
7370
}
7471

yew-oauth2-redirect-example/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn app() -> Html {
129129
back to the current page, which is detected as a new session, and will try to log in
130130
again, if the page requires this.
131131
*/
132-
.with_after_logout_url(Some("/".into()));
132+
.with_after_logout_url("/");
133133

134134
let mode = if cfg!(feature = "openid") {
135135
"OpenID Connect"

0 commit comments

Comments
 (0)