Skip to content

Commit

Permalink
fix(admin): don't start with empty session key
Browse files Browse the repository at this point in the history
fixes #414
  • Loading branch information
sentriz committed Nov 18, 2023
1 parent 1481f03 commit dd0f6b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/gonic/gonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ func main() {
log.Panicf("error getting session key: %v\n", err)
}
if sessKey == "" {
if err := dbc.SetSetting("session_key", string(securecookie.GenerateRandomKey(32))); err != nil {
sessKey = string(securecookie.GenerateRandomKey(32))
if err := dbc.SetSetting("session_key", sessKey); err != nil {
log.Panicf("error setting session key: %v\n", err)
}
}
Expand Down

0 comments on commit dd0f6b3

Please sign in to comment.