From e311e088c2d3451e2d90f3df534b93bdd0e5fb02 Mon Sep 17 00:00:00 2001 From: Azareal Date: Mon, 28 May 2018 21:31:19 +1000 Subject: [PATCH] Reverted back to URL safe randomly generated strings. Removed the redundant conditional. --- common/utils.go | 2 +- routes/account.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/common/utils.go b/common/utils.go index db94a894..50fd7ab6 100644 --- a/common/utils.go +++ b/common/utils.go @@ -48,7 +48,7 @@ func GenerateSafeString(length int) (string, error) { if err != nil { return "", err } - return base64.StdEncoding.EncodeToString(rb), nil + return base64.URLEncoding.EncodeToString(rb), nil } // TODO: Write a test for this diff --git a/routes/account.go b/routes/account.go index 4b8ed52f..c52beeca 100644 --- a/routes/account.go +++ b/routes/account.go @@ -78,9 +78,6 @@ func AccountLoginSubmit(w http.ResponseWriter, r *http.Request, user common.User } func AccountLogout(w http.ResponseWriter, r *http.Request, user common.User) common.RouteError { - if !user.Loggedin { - return common.LocalError("You can't logout without logging in first.", w, r, user) - } common.Auth.Logout(w, user.ID) http.Redirect(w, r, "/", http.StatusSeeOther) return nil