Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alicealys committed Sep 30, 2023
1 parent 6bda80f commit a689eaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/database/auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ namespace auth

std::optional<std::uint64_t> verify_ticket_offline(const std::string& auth_ticket, const size_t ticket_size)
{
if (auth_ticket.size() < 20)
const auto data = utils::cryptography::base64::decode(auth_ticket);
if (data.size() < 20)
{
return {};
}

const auto data = utils::cryptography::base64::decode(auth_ticket);
const auto data_ptr = reinterpret_cast<size_t>(data.data());
const auto account_id = *reinterpret_cast<std::uint64_t*>(data_ptr + 12);
return {account_id};
Expand Down

0 comments on commit a689eaa

Please sign in to comment.