mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-10 16:00:48 +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:
@@ -18,8 +18,8 @@ acceptallcustomnames=true
|
||||
# automatically create them?
|
||||
autocreateaccounts=true
|
||||
# list of supported authentication methods (comma-separated)
|
||||
# password = allow login type 1 with plaintext passwords
|
||||
# cookie = allow login type 2 with one-shot auth cookies
|
||||
# password = allow logging in with plaintext passwords
|
||||
# cookie = allow logging in with one-shot auth cookies
|
||||
authmethods=password
|
||||
# how often should everything be flushed to the database?
|
||||
# the default is 4 minutes
|
||||
|
||||
Reference in New Issue
Block a user