logout
This commit is contained in:
parent
e8a002d535
commit
6a828532cb
4 changed files with 23 additions and 0 deletions
|
|
@ -39,6 +39,15 @@ func userAuthenticate(rw http.ResponseWriter, username, password string) {
|
|||
http.SetCookie(rw, &cookie)
|
||||
}
|
||||
|
||||
func userLogout(rw http.ResponseWriter) {
|
||||
cookie := http.Cookie{
|
||||
Name: "auth",
|
||||
Value: "",
|
||||
MaxAge: -1,
|
||||
}
|
||||
http.SetCookie(rw, &cookie)
|
||||
}
|
||||
|
||||
func stringsEqual(p1, p2 string) bool {
|
||||
return subtle.ConstantTimeCompare([]byte(p1), []byte(p2)) == 1
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue