From 5b71518aa984e5898b95886faf9978b09868f7cc Mon Sep 17 00:00:00 2001 From: p0t4t0sandwich Date: Thu, 18 Apr 2024 05:40:44 -0600 Subject: [PATCH] Updated OAuth endpoint --- modules/auth/routes/authroutes.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auth/routes/authroutes.go b/modules/auth/routes/authroutes.go index 77e8cc4..fdb735e 100644 --- a/modules/auth/routes/authroutes.go +++ b/modules/auth/routes/authroutes.go @@ -18,7 +18,7 @@ import ( func ApplyRoutes(mux *http.ServeMux) *http.ServeMux { mux.HandleFunc("POST /api/v1/auth/login", LoginHandler) mux.Handle("POST /api/v1/auth/logout", mw.Auth(LogoutHandler)) - mux.HandleFunc("/api/v1/auth/discord", DiscordOAuthHandler) + mux.HandleFunc("/api/oauth", OAuthHandler) return mux } @@ -65,8 +65,8 @@ func LogoutHandler(w http.ResponseWriter, r *http.Request) { auth.DeleteSessionInDB(session.ID) } -// DiscordOAuthHandler handles the Discord OAuth route -func DiscordOAuthHandler(w http.ResponseWriter, r *http.Request) { +// OAuthHandler handles the Discord OAuth route +func OAuthHandler(w http.ResponseWriter, r *http.Request) { code := r.URL.Query().Get("code") if code == "" { responses.SendAndEncodeBadRequest(w, r, "Invalid request")