mirror of
https://github.com/pterodactyl/wings.git
synced 2025-12-10 00:32:17 -06:00
fix: use of old AuthenticationToken value
Signed-off-by: Matthew Penner <me@matthewp.io>
This commit is contained in:
parent
9535aae52e
commit
49b04fe9bb
@ -369,11 +369,11 @@ func NewAtPath(path string) (*Configuration, error) {
|
||||
// will be paused until it is complete.
|
||||
func Set(c *Configuration) {
|
||||
mu.Lock()
|
||||
if _config == nil || _config.AuthenticationToken != c.AuthenticationToken {
|
||||
_jwtAlgo = jwt.NewHS256([]byte(c.AuthenticationToken))
|
||||
defer mu.Unlock()
|
||||
if _config == nil || _config.Token.Token != c.Token.Token {
|
||||
_jwtAlgo = jwt.NewHS256([]byte(c.Token.Token))
|
||||
}
|
||||
_config = c
|
||||
mu.Unlock()
|
||||
}
|
||||
|
||||
// SetDebugViaFlag tracks if the application is running in debug mode because of
|
||||
@ -381,9 +381,9 @@ func Set(c *Configuration) {
|
||||
// change to the disk.
|
||||
func SetDebugViaFlag(d bool) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
_config.Debug = d
|
||||
_debugViaFlag = d
|
||||
mu.Unlock()
|
||||
}
|
||||
|
||||
// Get returns the global configuration instance. This is a thread-safe operation
|
||||
@ -408,8 +408,8 @@ func Get() *Configuration {
|
||||
// the global configuration.
|
||||
func Update(callback func(c *Configuration)) {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
callback(_config)
|
||||
mu.Unlock()
|
||||
}
|
||||
|
||||
// GetJwtAlgorithm returns the in-memory JWT algorithm.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user