fix: don't allow fallback for users in local db
This commit is contained in:
parent
0f310896d7
commit
be3362f7dd
1 changed files with 5 additions and 4 deletions
|
@ -42,13 +42,14 @@ pub async fn has_joined_wrapper(State(state): State<AppState>, Query(query): Que
|
||||||
|
|
||||||
match has_joined_local(&state, username, server_id, user_ip).await {
|
match has_joined_local(&state, username, server_id, user_ip).await {
|
||||||
Ok(r) => Ok(r),
|
Ok(r) => Ok(r),
|
||||||
Err(e) => {
|
Err(StatusCode::MOVED_PERMANENTLY) => {
|
||||||
if state.fallback {
|
if state.fallback {
|
||||||
Ok(has_joined_microsoft(&state, username, server_id, user_ip).await?)
|
Ok(has_joined_microsoft(&state, username, server_id, user_ip).await?)
|
||||||
} else {
|
} else {
|
||||||
Err(e)
|
Err(StatusCode::UNAUTHORIZED)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
Err(e) => Err(e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +99,7 @@ pub async fn has_joined_local(state: &AppState, username: &String, server_id: &S
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
warn!(target: "SESSION", "[HAS_JOINED] server didn't find user");
|
warn!(target: "SESSION", "[HAS_JOINED] server didn't find user");
|
||||||
Err(StatusCode::NOT_FOUND)
|
Err(StatusCode::MOVED_PERMANENTLY)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue