mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-10 02:33:36 +08:00
@@ -510,7 +510,14 @@ func (u *UserUsecase) OAuthCallback(c *web.Context, req *domain.OAuthCallbackReq
|
||||
|
||||
switch session.Kind {
|
||||
case consts.OAuthKindInvite:
|
||||
setting, err := u.repo.GetSetting(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, redirect, err := u.WithOAuthCallback(ctx, req, &session, func(ctx context.Context, s *domain.OAuthState, oui *domain.OAuthUserInfo) (*db.User, error) {
|
||||
if setting.EnableAutoLogin {
|
||||
return u.repo.SignUpOrIn(ctx, s.Platform, oui)
|
||||
}
|
||||
return u.repo.OAuthRegister(ctx, s.Platform, s.InviteCode, oui)
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user