Fix uuid not matching because uuid isn't hyphenated

This commit is contained in:
0xf8 2023-06-21 16:57:15 -04:00
parent c1eeabc07c
commit 49f462370a
Signed by: 0xf8
GPG Key ID: 446580D758689584

View File

@ -48,7 +48,13 @@ pub async fn join(mut req: Request<Database>) -> Result {
return Err(YggdrasilError::new_base("Account has no profile.").into()) 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 // UUID doesn't match
return Err(YggdrasilError::new_base("UUID doesn't match.").into()) return Err(YggdrasilError::new_base("UUID doesn't match.").into())
} }