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