Potion/internal/app/handlers/auth_handler.go
Hayden Hargreaves a9cdc25adf (FEAT): Implemented the first stages of Google OAuth.
All that's left is the UI and repository implementation.
2025-06-13 22:50:46 -07:00

22 lines
457 B
Go

package handlers
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/haydenhargreaves/Potion/internal/app/service"
)
func GoogleLogin(ctx *gin.Context) {
url := service.GoogleLogin(ctx)
ctx.Redirect(http.StatusSeeOther, url)
}
func GoogleCallback(ctx *gin.Context) {
if googleUserInfo, err := service.GoogleCallback(ctx); err != nil {
ctx.JSON(http.StatusInternalServerError, err)
} else {
ctx.JSON(http.StatusOK, googleUserInfo)
}
}