aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth/src
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-12-07 21:58:42 -0600
committerGitHub <noreply@github.com>2022-12-07 21:58:42 -0600
commit431f9e90a782c42f9d28a85d1d18288e352d3e0c (patch)
tree2ef9ed32d214efb1f93164b8eb88f3a6b2674430 /azalea-auth/src
parent7d901e39bc10a855b545d7b6c167f45148a1fb0a (diff)
downloadazalea-drasl-431f9e90a782c42f9d28a85d1d18288e352d3e0c.tar.xz
Reauth on invalid session (#50)
* Reauth on invalid session * fix to actually use new token and retry auth * fix unused vars
Diffstat (limited to 'azalea-auth/src')
-rwxr-xr-xazalea-auth/src/sessionserver.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/azalea-auth/src/sessionserver.rs b/azalea-auth/src/sessionserver.rs
index fe0b694a..800a9642 100755
--- a/azalea-auth/src/sessionserver.rs
+++ b/azalea-auth/src/sessionserver.rs
@@ -13,6 +13,10 @@ pub enum SessionServerError {
MultiplayerDisabled,
#[error("This account has been banned from multiplayer")]
Banned,
+ #[error("The authentication servers are currently not reachable")]
+ AuthServersUnreachable,
+ #[error("Invalid or expired session")]
+ InvalidSession,
#[error("Unknown sessionserver error: {0}")]
Unknown(String),
#[error("Unexpected response from sessionserver (status code {status_code}): {body}")]
@@ -64,6 +68,10 @@ pub async fn join(
match forbidden.error.as_str() {
"InsufficientPrivilegesException" => Err(SessionServerError::MultiplayerDisabled),
"UserBannedException" => Err(SessionServerError::Banned),
+ "AuthenticationUnavailableException" => {
+ Err(SessionServerError::AuthServersUnreachable)
+ }
+ "InvalidCredentialsException" => Err(SessionServerError::InvalidSession),
_ => Err(SessionServerError::Unknown(forbidden.error)),
}
}