From fa332a6eddd26069ef16256ca56bcc0743920f2a Mon Sep 17 00:00:00 2001 From: Erikas Date: Fri, 5 Jul 2024 10:20:35 +0300 Subject: [PATCH] do not allow re-login if already logged in --- auth.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auth.go b/auth.go index af2fbc5..886d322 100644 --- a/auth.go +++ b/auth.go @@ -20,6 +20,11 @@ type DiscordUser struct { func getLogin(c *gin.Context) { session := sessions.Default(c) + if session.Get("ID") != nil { + c.Redirect(http.StatusTemporaryRedirect, "/") + return + } + discordState, err := getRandomString() if err != nil { c.HTML(http.StatusInternalServerError, "error_raw.tmpl", gin.H{