Skip to content
Clone
d5939db
23 lines 671 B Rust
use super::types::{
AuthorizationUrlResp, AuthorizeCmd, CallbackCmd, OAuthLoginResp, OAuthProviderInfo,
};
use super::usecase;
use crate::error::AuthError;
use crate::features::AuthService;
impl AuthService {
pub fn list_oauth_providers(&self) -> Vec<OAuthProviderInfo> {
usecase::list_providers(&self.config)
}
pub async fn oauth_authorize(
&self,
cmd: AuthorizeCmd,
) -> Result<AuthorizationUrlResp, AuthError> {
usecase::oauth_authorize(cmd, self).await
}
pub async fn oauth_callback(&self, cmd: CallbackCmd) -> Result<OAuthLoginResp, AuthError> {
usecase::oauth_callback(cmd, self).await
}
}