Sessions are keyed by a session_id so we can just store anything. Adding the user_id for later authorization stuff.

master
Zed A. Shaw 3 days ago
parent 4bd6cfc8ce
commit c8b60a6aa5
  1. 2
      api/auth.go

@ -112,8 +112,8 @@ func PostApiLogin(c *fiber.Ctx) error {
sess, err := STORE.Get(c)
if err != nil { return IfErrNil(err, c) }
// BUG: THIS IS A BIG NO NO, just for getting going
sess.Set("authenticated", true)
sess.Set("user_id", user.Id)
sess.Set("admin", IsAdmin(&user))
err = sess.Save()
if err != nil { return IfErrNil(err, c) }

Loading…
Cancel
Save