mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	clean tail
This commit is contained in:
		@@ -1,9 +1,6 @@
 | 
				
			|||||||
package models
 | 
					package models
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import "errors"
 | 
				
			||||||
	"errors"
 | 
					 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// OT: Oauth2 Type
 | 
					// OT: Oauth2 Type
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
@@ -41,8 +38,7 @@ func GetOauth2(identity string) (oa *Oauth2, err error) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if !exists {
 | 
						if !exists {
 | 
				
			||||||
		err = fmt.Errorf("not exists oauth2: %s", identity)
 | 
							return nil, ErrOauth2RecordNotExists
 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if oa.Uid == 0 {
 | 
						if oa.Uid == 0 {
 | 
				
			||||||
		return oa, ErrOauth2NotAssociatedWithUser
 | 
							return oa, ErrOauth2NotAssociatedWithUser
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -109,6 +109,9 @@ func SocialSignIn(ctx *middleware.Context, tokens oauth2.Tokens) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	case models.ErrOauth2NotAssociatedWithUser:
 | 
						case models.ErrOauth2NotAssociatedWithUser:
 | 
				
			||||||
		// pass
 | 
							// pass
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							log.Error(err) // FIXME: handle error page
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	ctx.Session.Set("socialId", oa.Id)
 | 
						ctx.Session.Set("socialId", oa.Id)
 | 
				
			||||||
	log.Info("socialId: %v", oa.Id)
 | 
						log.Info("socialId: %v", oa.Id)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user