Skip to content

Commit

Permalink
Updated OAuth endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
p0t4t0sandwich committed Apr 18, 2024
1 parent fa8ca17 commit 5b71518
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/auth/routes/authroutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 5b71518

Please sign in to comment.