|
@@ -74,6 +74,7 @@ func loginHandler(ctx *iris.Context) { // TODO outsource?
|
|
|
user := usermanager.User{} // new user
|
|
user := usermanager.User{} // new user
|
|
|
tokenString, err := user.Login(username, password) // try to login
|
|
tokenString, err := user.Login(username, password) // try to login
|
|
|
ctx.SetCookieKV("token", tokenString)
|
|
ctx.SetCookieKV("token", tokenString)
|
|
|
|
|
+ ctx.Set("token", tokenString) // set tokenstring as ctx-param as cookie can't be read in next context(s)
|
|
|
|
|
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
errorhelpers.HandleError(err, ctx)
|
|
errorhelpers.HandleError(err, ctx)
|