mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-03-28 15:40:03 +00:00
Refactor login packet handler for more flexible auth (#298)
This PR enables auth cookies to be used simultaneously with plaintext paasswords sent in the cookie authID field. * Hoist a bunch of checks from the login packet handler into helper functions. * Rename the LoginType enum to AuthMethod and distinguish it from the iLoginType packet field (see comment in code for why these should be decoupled). * If the provided token does not pass the cookie check and password auth is enabled, treat it as a plaintext password and authenticate if it is correct.
This commit is contained in:
@@ -49,6 +49,7 @@ std::string U16toU8(char16_t* src, size_t max);
|
||||
size_t U8toU16(std::string src, char16_t* des, size_t max); // returns number of char16_t that was written at des
|
||||
time_t getTime();
|
||||
time_t getTimestamp();
|
||||
int timingSafeStrcmp(const char* a, const char* b);
|
||||
void terminate(int);
|
||||
|
||||
// The PROTOCOL_VERSION definition can be defined by the build system.
|
||||
|
||||
Reference in New Issue
Block a user