Skip to content

Commit

Permalink
simplified routes
Browse files Browse the repository at this point in the history
  • Loading branch information
axrav committed Aug 23, 2022
1 parent fff333d commit 267d906
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions oauth2-google/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
Obtain OAuth credentials from https://console.developers.google.com/

## Endpoints
/ - redirects to login url
/auth/google/callback - gives a callback to google and on success return's user's email
- /api/ - redirects to login url

- /api/auth/google/callback - gives a callback to google and on success return's user's email

## Packages Used
- [Godotenv](https://github.com/joho/godotenv)
Expand Down
6 changes: 4 additions & 2 deletions oauth2-google/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"fiber-oauth-google/handler"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
)

// setting up the routes for google authentication with gofiber

func Routes(app *fiber.App) {
app.Get("/", handler.Auth)
app.Get("/auth/google/callback", handler.Callback)
api := app.Group("/api", logger.New())
api.Get("/", handler.Auth)
api.Get("/auth/google/callback", handler.Callback)

}

0 comments on commit 267d906

Please sign in to comment.