mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 05:06:53 +00:00
OIDC: impl client_registrar over db (sync impl)
This commit is contained in:
1 parent
f2e696ae3e
commit
900ba33a4e
7 files changed
+361
-301
No files matched your search
@@ -272,7 +272,7 @@ impl Service {
|
||||
/// Find out which user an access token belongs to.
|
||||
pub async fn find_from_token(&self, token: &str) -> Result<(OwnedUserId, OwnedDeviceId)> {
|
||||
if self.services.server.config.auth.as_ref().is_some_and(|auth| auth.enable_oidc_login) {
|
||||
self.services.oidc.user_and_device_from_token(token)
|
||||
self.services.oidc.user_and_device_from_token(token).await
|
||||
} else {
|
||||
self.db.token_userdeviceid.get(token).await.deserialized()
|
||||
}
|
||||
@@ -542,7 +542,7 @@ impl Service {
|
||||
// either...
|
||||
let key = (user_id, device_id);
|
||||
if self.services.server.config.auth.as_ref().is_some_and(|auth| auth.enable_oidc_login) {
|
||||
if self.services.oidc.client_from_device_id(device_id.into()).is_none() {
|
||||
if self.services.oidc.client_from_device_id(device_id.into()).await?.is_none() {
|
||||
return Err!(Database(error!(
|
||||
?user_id,
|
||||
?device_id,
|
||||
|
||||
Reference in new issue
Block a user