mirror of
https://github.com/chirpstack/chirpstack.git
synced 2024-12-19 05:07:54 +00:00
Fix Chirpstack overwriting user updates by OIDC user provisioning callback (#343)
Co-authored-by: Orne Brocaar <info@brocaar.com>
This commit is contained in:
parent
e379e8738c
commit
f248379259
@ -56,13 +56,16 @@ impl Internal {
|
|||||||
external_id: Some(external_id.to_string()),
|
external_id: Some(external_id.to_string()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let u = user::create(u).await?;
|
let mut u = user::create(u).await?;
|
||||||
if let Err(e) = self.provision_user(&u.id, user_info).await {
|
if let Err(e) = self.provision_user(&u.id, user_info).await {
|
||||||
error!(error = %e, "Provisioning user failed");
|
error!(error = %e, "Provisioning user failed");
|
||||||
user::delete(&u.id).await?;
|
user::delete(&u.id).await?;
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fetch user again because the provisioning callback url may have updated the user.
|
||||||
|
u = user::get(&u.id).await?;
|
||||||
|
|
||||||
Ok(u)
|
Ok(u)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user