mirror of
https://github.com/pterodactyl/wings.git
synced 2025-12-10 15:40:14 -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.
|
// will be paused until it is complete.
|
||||||
func Set(c *Configuration) {
|
func Set(c *Configuration) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
if _config == nil || _config.AuthenticationToken != c.AuthenticationToken {
|
defer mu.Unlock()
|
||||||
_jwtAlgo = jwt.NewHS256([]byte(c.AuthenticationToken))
|
if _config == nil || _config.Token.Token != c.Token.Token {
|
||||||
|
_jwtAlgo = jwt.NewHS256([]byte(c.Token.Token))
|
||||||
}
|
}
|
||||||
_config = c
|
_config = c
|
||||||
mu.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetDebugViaFlag tracks if the application is running in debug mode because of
|
// SetDebugViaFlag tracks if the application is running in debug mode because of
|
||||||
@ -381,9 +381,9 @@ func Set(c *Configuration) {
|
|||||||
// change to the disk.
|
// change to the disk.
|
||||||
func SetDebugViaFlag(d bool) {
|
func SetDebugViaFlag(d bool) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
|
defer mu.Unlock()
|
||||||
_config.Debug = d
|
_config.Debug = d
|
||||||
_debugViaFlag = d
|
_debugViaFlag = d
|
||||||
mu.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get returns the global configuration instance. This is a thread-safe operation
|
// Get returns the global configuration instance. This is a thread-safe operation
|
||||||
@ -408,8 +408,8 @@ func Get() *Configuration {
|
|||||||
// the global configuration.
|
// the global configuration.
|
||||||
func Update(callback func(c *Configuration)) {
|
func Update(callback func(c *Configuration)) {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
|
defer mu.Unlock()
|
||||||
callback(_config)
|
callback(_config)
|
||||||
mu.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetJwtAlgorithm returns the in-memory JWT algorithm.
|
// GetJwtAlgorithm returns the in-memory JWT algorithm.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user