Skip to content

Commit 0fea6f5

Browse files
committed
better debug...
1 parent 6391189 commit 0fea6f5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/routes/users.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,15 @@ pub fn kth_oidc_auth(
107107
println!("starting oidc auth");
108108
// cookies.add(Cookie::new("nonce", nonce.secret().clone()));
109109
match cookies.get("nonce") {
110-
Some(nonce) => match get_oidc_user(params, Nonce::new(nonce.to_string())) {
111-
Ok(_) => println!("good login!"),
112-
Err(err) => {
113-
println!("oidc error: {:?}", err);
110+
Some(nonce) => {
111+
println!("got nonce: {}", nonce);
112+
match get_oidc_user(params, Nonce::new(nonce.to_string())) {
113+
Ok(_) => println!("good login!"),
114+
Err(err) => {
115+
println!("oidc error: {:?}", err);
116+
}
114117
}
115-
},
118+
}
116119
None => println!("failed to get nonce"),
117120
}
118121
Redirect::to("/")
@@ -187,12 +190,12 @@ pub fn use_oidc(mut cookies: Cookies) -> Result<Redirect> {
187190
// process.
188191

189192
cookies.add(Cookie::new("nonce", nonce.secret().clone()));
190-
println!("wrote nonce: {:?}", nonce);
193+
println!("wrote nonce: {:?}", nonce.secret());
191194
Ok(Redirect::to(auth_url.to_string()))
192195
}
193196

194197
pub fn get_oidc_user(params: Form<Code>, nonce: Nonce) -> Result<()> {
195-
println!("got nonce: {:?}", nonce);
198+
println!("got nonce: {:?}", nonce.secret());
196199
let client = get_client()?;
197200
println!("getting oidc_user");
198201
let code = params

0 commit comments

Comments
 (0)