Skip to content

Commit 889cb56

Browse files
committed
It should now work
1 parent 2a32d75 commit 889cb56

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/routes/login.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use openidconnect::reqwest::http_client;
2727
use openidconnect::{OAuth2TokenResponse, TokenResponse};
2828

2929
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
30-
#[serde(rename_all = "camelCase")]
3130
pub struct KthAdditionalClaims {
3231
kthid: String,
3332
username: String,
@@ -200,6 +199,11 @@ pub fn get_oidc_user(params: Form<Code>, nonce: Nonce) -> Result<LdapUser> {
200199
Ok(LdapUser {
201200
username: claims.additional_claims().username.clone(),
202201
ugkthid: claims.additional_claims().kthid.clone(),
203-
realname: claims.additional_claims().unique_name[0].clone(),
202+
realname: claims
203+
.additional_claims()
204+
.unique_name
205+
.get(0)
206+
.ok_or(anyhow!("The person doesn't have a name"))?
207+
.clone(),
204208
})
205209
}

0 commit comments

Comments
 (0)