From 49f462370a4dd9c4e0087e9d7cc974ed979eb3c3 Mon Sep 17 00:00:00 2001 From: 0xf8 <0xf8.dev@proton.me> Date: Wed, 21 Jun 2023 16:57:15 -0400 Subject: [PATCH] Fix uuid not matching because uuid isn't hyphenated --- src/server/session/join.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/session/join.rs b/src/server/session/join.rs index a5e1c06..4c20107 100644 --- a/src/server/session/join.rs +++ b/src/server/session/join.rs @@ -48,7 +48,13 @@ pub async fn join(mut req: Request) -> Result { return Err(YggdrasilError::new_base("Account has no profile.").into()) }; - if body.profile_uuid != profile.uuid { + // Re-hyphenate token if not already + let given_uuid = match body.profile_uuid.find("-") { + None => Token::rehyphenate(body.profile_uuid), + Some(_) => body.profile_uuid + }; + + if given_uuid != profile.uuid { // UUID doesn't match return Err(YggdrasilError::new_base("UUID doesn't match.").into()) }