bit more progress

This commit is contained in:
tsmethurst 2021-07-21 19:00:45 +02:00
commit 8e0d32d3e1
9 changed files with 241 additions and 80 deletions

View file

@ -18,4 +18,22 @@
package auth
import (
"net/http"
"github.com/gin-gonic/gin"
)
// CallbackGETHandler parses a token from an external auth provider.
func (m *Module) CallbackGETHandler(c *gin.Context) {
state := c.Query(callbackStateParam)
code := c.Query(callbackCodeParam)
claims, err := m.idp.HandleCallback(c.Request.Context(), state, code)
if err != nil {
c.String(http.StatusForbidden, err.Error())
return
}
c.JSON(http.StatusOK, claims)
}