Skip to content

Commit

Permalink
Add OAuth2 authentication route structure (#353)
Browse files Browse the repository at this point in the history
- Create basic OAuth2 routes for provider auth, callback and logout.
- Add placeholder implementation for OAuth2 handler.
- Register auth routes in main route initialization.
  • Loading branch information
huiyifyj authored Jan 24, 2025
1 parent 353b15d commit 3535c07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/route/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package route

import (
"github.com/gin-gonic/gin"
)

func authRoutes(g *gin.Engine) {
// OAuth2
g.POST("/oauth/:provider", oauth2)
g.POST("/oauth/callback", oauth2)
g.POST("/oauth/logout", oauth2)
}

func oauth2(c *gin.Context) {
c.String(200, "not implemented")
}
1 change: 1 addition & 0 deletions src/route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func InitRoutes() error {
debugRoutes(g)
}
apiRoutes(g)
authRoutes(g)
errorRoute(g)
adminRoutes(g)
othersRoutes(g)
Expand Down

0 comments on commit 3535c07

Please sign in to comment.