mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-05 20:32:50 +02:00
format Go source code.
This commit is contained in:
parent
732764991b
commit
45679f1b86
54 changed files with 445 additions and 447 deletions
|
@ -1,12 +1,12 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"time"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"demodesk/neko/internal/utils"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/http/auth"
|
||||
"demodesk/neko/internal/types"
|
||||
"demodesk/neko/internal/utils"
|
||||
)
|
||||
|
||||
type SessionLoginPayload struct {
|
||||
|
@ -33,16 +33,16 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: "neko-id",
|
||||
Value: session.ID(),
|
||||
Expires: time.Now().Add(365 * 24 * time.Hour),
|
||||
Name: "neko-id",
|
||||
Value: session.ID(),
|
||||
Expires: time.Now().Add(365 * 24 * time.Hour),
|
||||
HttpOnly: false,
|
||||
})
|
||||
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: "neko-secret",
|
||||
Value: data.Secret,
|
||||
Expires: time.Now().Add(365 * 24 * time.Hour),
|
||||
Name: "neko-secret",
|
||||
Value: data.Secret,
|
||||
Expires: time.Now().Add(365 * 24 * time.Hour),
|
||||
HttpOnly: true,
|
||||
})
|
||||
|
||||
|
@ -55,16 +55,16 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func (api *ApiManagerCtx) Logout(w http.ResponseWriter, r *http.Request) {
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: "neko-id",
|
||||
Value: "",
|
||||
Expires: time.Unix(0, 0),
|
||||
Name: "neko-id",
|
||||
Value: "",
|
||||
Expires: time.Unix(0, 0),
|
||||
HttpOnly: false,
|
||||
})
|
||||
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: "neko-secret",
|
||||
Value: "",
|
||||
Expires: time.Unix(0, 0),
|
||||
Name: "neko-secret",
|
||||
Value: "",
|
||||
Expires: time.Unix(0, 0),
|
||||
HttpOnly: true,
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue