mirror of https://gitee.com/answerdev/answer.git
feat(plugin): external user login add access token
This commit is contained in:
parent
fe6a53fb62
commit
8575bbf8c8
|
@ -5723,6 +5723,9 @@ const docTemplate = `{
|
|||
"schema.ExternalLoginBindingUserSendEmailResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token": {
|
||||
"type": "string"
|
||||
},
|
||||
"email_exist_and_must_be_confirmed": {
|
||||
"type": "boolean"
|
||||
}
|
||||
|
|
|
@ -5711,6 +5711,9 @@
|
|||
"schema.ExternalLoginBindingUserSendEmailResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"access_token": {
|
||||
"type": "string"
|
||||
},
|
||||
"email_exist_and_must_be_confirmed": {
|
||||
"type": "boolean"
|
||||
}
|
||||
|
|
|
@ -312,6 +312,8 @@ definitions:
|
|||
type: object
|
||||
schema.ExternalLoginBindingUserSendEmailResp:
|
||||
properties:
|
||||
access_token:
|
||||
type: string
|
||||
email_exist_and_must_be_confirmed:
|
||||
type: boolean
|
||||
type: object
|
||||
|
|
|
@ -76,8 +76,8 @@ func (cc *ConnectorController) ConnectorRedirect(connector plugin.Connector) (fn
|
|||
Provider: connector.ConnectorSlugName(),
|
||||
ExternalID: userInfo.ExternalID,
|
||||
Name: userInfo.Name,
|
||||
Email: userInfo.Email,
|
||||
MetaInfo: userInfo.MetaInfo,
|
||||
//Email: userInfo.Email,
|
||||
MetaInfo: userInfo.MetaInfo,
|
||||
}
|
||||
resp, err := cc.userExternalService.ExternalLogin(ctx, u)
|
||||
if err != nil {
|
||||
|
|
|
@ -17,7 +17,8 @@ type ExternalLoginBindingUserSendEmailReq struct {
|
|||
|
||||
// ExternalLoginBindingUserSendEmailResp external login binding user response
|
||||
type ExternalLoginBindingUserSendEmailResp struct {
|
||||
EmailExistAndMustBeConfirmed bool `json:"email_exist_and_must_be_confirmed"`
|
||||
EmailExistAndMustBeConfirmed bool `json:"email_exist_and_must_be_confirmed"`
|
||||
AccessToken string `json:"access_token"`
|
||||
}
|
||||
|
||||
// ExternalLoginBindingUserReq external login binding user request
|
||||
|
|
|
@ -180,6 +180,11 @@ func (us *UserExternalLoginService) ExternalLoginBindingUserSendEmail(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.AccessToken, _, err = us.userCommonService.CacheLoginUserInfo(
|
||||
ctx, userInfo.ID, userInfo.MailStatus, userInfo.Status)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
err = us.userExternalLoginRepo.SetCacheUserExternalLoginInfo(ctx, req.BindingKey, externalLoginInfo)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue