Box::pin authenticate function
This commit is contained in:
@@ -82,12 +82,13 @@ impl Authenticator for Server {
|
||||
};
|
||||
|
||||
// Authenticate
|
||||
let access_token = Box::pin(self.authenticate(&AuthRequest::from_credentials(
|
||||
credentials,
|
||||
session.session_id,
|
||||
session.remote_ip,
|
||||
)))
|
||||
.await?;
|
||||
let access_token = self
|
||||
.authenticate(&AuthRequest::from_credentials(
|
||||
credentials,
|
||||
session.session_id,
|
||||
session.remote_ip,
|
||||
))
|
||||
.await?;
|
||||
|
||||
// Cache credentials
|
||||
self.inner.cache.http_auth.insert(
|
||||
|
||||
@@ -49,7 +49,7 @@ impl ClientRegistrationHandler for Server {
|
||||
) -> trc::Result<HttpResponse> {
|
||||
let tenant_id = if !self.core.oauth.allow_anonymous_client_registration {
|
||||
// Authenticate request
|
||||
let (_, access_token) = Box::pin(self.authenticate_headers(req, &session)).await?;
|
||||
let (_, access_token) = self.authenticate_headers(req, &session).await?;
|
||||
|
||||
// Validate permissions
|
||||
access_token.enforce_permission(Permission::OAuthClientRegistration)?;
|
||||
|
||||
Reference in New Issue
Block a user