use async_trait::async_trait;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct SocialUser {
pub id: String,
pub name: String,
pub email: String,
pub avatar: Option<String>,
pub provider: String,
}
#[async_trait]
pub trait SocialProvider: Send + Sync {
fn name(&self) -> &str;
fn get_redirect_url(&self) -> String;
async fn get_user_by_code(&self, code: String) -> Result<SocialUser, String>;
}