mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-30 23:09:01 +02:00
OnHostChanged event and add tokens to session.
This commit is contained in:
parent
453a6905f7
commit
3fcca6ab52
6 changed files with 43 additions and 12 deletions
|
@ -31,7 +31,7 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
// TODO: Proper login.
|
||||
session, err := api.sessions.Create(types.MemberProfile{
|
||||
session, token, err := api.sessions.Create(types.MemberProfile{
|
||||
Name: data.ID,
|
||||
IsAdmin: true,
|
||||
CanLogin: true,
|
||||
|
@ -53,7 +53,7 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: "NEKO_SESSION",
|
||||
Value: session.ID(),
|
||||
Value: token,
|
||||
Expires: CookieExpirationDate,
|
||||
Secure: !UnsecureCookies,
|
||||
SameSite: sameSite,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue