Reverted back to URL safe randomly generated strings.
Removed the redundant conditional.
This commit is contained in:
parent
4d6a7bfda1
commit
e311e088c2
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue