This commit is contained in:
parent
9ae6d88c21
commit
7c3fac6bf8
2 changed files with 2 additions and 2 deletions
|
|
@ -216,7 +216,7 @@ pub struct TokenResponse {
|
||||||
pub struct Claims {
|
pub struct Claims {
|
||||||
pub sub: String,
|
pub sub: String,
|
||||||
pub email: Option<String>,
|
pub email: Option<String>,
|
||||||
pub name: Option<String>,
|
pub preferred_username: Option<String>,
|
||||||
pub exp: usize,
|
pub exp: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ pub async fn callback(
|
||||||
Ok(claims) => {
|
Ok(claims) => {
|
||||||
let sub = claims.sub;
|
let sub = claims.sub;
|
||||||
let email = claims.email.unwrap_or_default();
|
let email = claims.email.unwrap_or_default();
|
||||||
let name = claims.name.unwrap_or_default();
|
let name = claims.preferred_username.unwrap_or_default();
|
||||||
|
|
||||||
let existing_user = user::Entity::find()
|
let existing_user = user::Entity::find()
|
||||||
.filter(user::Column::Sub.eq(&sub))
|
.filter(user::Column::Sub.eq(&sub))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue