mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 20:32:11 +00:00
Fix issue with log in with GitHub but need more error handle after
This commit is contained in:
parent
05fb34eacd
commit
9ea9818d32
13 changed files with 167 additions and 60 deletions
|
@ -1,20 +1,20 @@
|
|||
// Copyright 2014 The Gogs Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package user
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
|
||||
"code.google.com/p/goauth2/oauth"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/base"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
"github.com/gogits/gogs/modules/middleware"
|
||||
//"github.com/gogits/gogs/modules/oauth2"
|
||||
|
||||
"code.google.com/p/goauth2/oauth"
|
||||
"github.com/martini-contrib/oauth2"
|
||||
"github.com/gogits/gogs/modules/oauth2"
|
||||
)
|
||||
|
||||
type SocialConnector interface {
|
||||
|
@ -80,6 +80,10 @@ func SocialSignIn(ctx *middleware.Context, tokens oauth2.Tokens) {
|
|||
Extra: tokens.ExtraData(),
|
||||
},
|
||||
}
|
||||
if len(tokens.Access()) == 0 {
|
||||
log.Error("empty access")
|
||||
return
|
||||
}
|
||||
var err error
|
||||
var u *models.User
|
||||
if err = gh.Update(); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue