Reverted back to URL safe randomly generated strings.

Removed the redundant conditional.
This commit is contained in:
Azareal 2018-05-28 21:31:19 +10:00
parent 4d6a7bfda1
commit e311e088c2
2 changed files with 1 additions and 4 deletions

View File

@ -48,7 +48,7 @@ func GenerateSafeString(length int) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
return base64.StdEncoding.EncodeToString(rb), nil return base64.URLEncoding.EncodeToString(rb), nil
} }
// TODO: Write a test for this // TODO: Write a test for this

View File

@ -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 { 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) common.Auth.Logout(w, user.ID)
http.Redirect(w, r, "/", http.StatusSeeOther) http.Redirect(w, r, "/", http.StatusSeeOther)
return nil return nil