fix: add oauth2 callback type

pull/242/head
zijiren233 11 months ago
parent 900da0aa2c
commit 7f35a9594d

@ -201,6 +201,7 @@ func newAuthFunc(redirect string) stateHandler {
}
} else if ctx.Request.Method == http.MethodPost {
ctx.JSON(http.StatusOK, model.NewApiDataResp(gin.H{
"type": CallbackTypeAuth,
"role": user.Role,
"token": token,
"redirect": redirect,

@ -91,6 +91,7 @@ func newBindFunc(userID, redirect string) stateHandler {
}
ctx.JSON(http.StatusOK, model.NewApiDataResp(gin.H{
"type": CallbackTypeBind,
"redirect": redirect,
}))
}

@ -0,0 +1,8 @@
package auth
type CallbackType string
const (
CallbackTypeAuth CallbackType = "auth"
CallbackTypeBind CallbackType = "bind"
)
Loading…
Cancel
Save