Fix uuid not matching because uuid isn't hyphenated
This commit is contained in:
parent
c1eeabc07c
commit
49f462370a
@ -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())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user