mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 15:23:03 -06:00
bit more progress
This commit is contained in:
parent
40917c2cd9
commit
8e0d32d3e1
9 changed files with 241 additions and 80 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue