do not allow re-login if already logged in

This commit is contained in:
Erikas 2024-07-05 10:20:35 +03:00
parent 797d181bea
commit fa332a6edd

View File

@ -20,6 +20,11 @@ type DiscordUser struct {
func getLogin(c *gin.Context) { func getLogin(c *gin.Context) {
session := sessions.Default(c) session := sessions.Default(c)
if session.Get("ID") != nil {
c.Redirect(http.StatusTemporaryRedirect, "/")
return
}
discordState, err := getRandomString() discordState, err := getRandomString()
if err != nil { if err != nil {
c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{ c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{