fix, desktop, oidc login
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
5455cd3dea
commit
5ee0d0c994
@ -83,11 +83,16 @@ pub enum UserStatus {
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct UserPayload {
|
||||
pub name: String,
|
||||
#[serde(default)]
|
||||
pub email: Option<String>,
|
||||
#[serde(default)]
|
||||
pub note: Option<String>,
|
||||
#[serde(default)]
|
||||
pub status: UserStatus,
|
||||
pub info: UserInfo,
|
||||
#[serde(default)]
|
||||
pub is_admin: bool,
|
||||
#[serde(default)]
|
||||
pub third_auth_type: Option<String>,
|
||||
}
|
||||
|
||||
@ -117,6 +122,12 @@ pub struct AuthResult {
|
||||
pub auth_body: Option<AuthBody>,
|
||||
}
|
||||
|
||||
impl Default for UserStatus {
|
||||
fn default() -> Self {
|
||||
UserStatus::Normal
|
||||
}
|
||||
}
|
||||
|
||||
impl OidcSession {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
@ -216,7 +227,7 @@ impl OidcSession {
|
||||
let query_timeout = OIDC_SESSION.read().unwrap().query_timeout;
|
||||
while OIDC_SESSION.read().unwrap().keep_querying && begin.elapsed() < query_timeout {
|
||||
match Self::query(&code_url.code, &id, &uuid) {
|
||||
Ok(HbbHttpResponse::<_>::Data(mut auth_body)) => {
|
||||
Ok(HbbHttpResponse::<_>::Data(auth_body)) => {
|
||||
if remember_me {
|
||||
LocalConfig::set_option(
|
||||
"access_token".to_owned(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user