summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-12 16:19:16 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-12 16:19:16 -0400
commitd60f7b85e53d0d2fbef9d8e2a8b539f9c0d97233 (patch)
tree920d2ef7c9ac40f7bcb955a72b8d3b30b88dff1d /models
parent47f3dd43a52d05b1f12921c4e9cc3300a4a49060 (diff)
parent75d2affcbf9b26c5a989a75a6654d9b6e21415e9 (diff)
downloadgitea-d60f7b85e53d0d2fbef9d8e2a8b539f9c0d97233.tar.gz
gitea-d60f7b85e53d0d2fbef9d8e2a8b539f9c0d97233.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'models')
-rw-r--r--models/oauth2.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/oauth2.go b/models/oauth2.go
index c5d58c0749..f8780fe682 100644
--- a/models/oauth2.go
+++ b/models/oauth2.go
@@ -13,6 +13,7 @@ const (
OT_GITHUB = iota + 1
OT_GOOGLE
OT_TWITTER
+ OT_QQ
)
var (
@@ -26,7 +27,7 @@ type Oauth2 struct {
User *User `xorm:"-"`
Type int `xorm:"unique(s) unique(oauth)"` // twitter,github,google...
Identity string `xorm:"unique(s) unique(oauth)"` // id..
- Token string `xorm:"VARCHAR(200) not null"`
+ Token string `xorm:"TEXT not null"`
}
func BindUserOauth2(userId, oauthId int64) error {
@@ -48,7 +49,7 @@ func GetOauth2(identity string) (oa *Oauth2, err error) {
return
} else if !isExist {
return nil, ErrOauth2RecordNotExists
- } else if oa.Uid == 0 {
+ } else if oa.Uid == -1 {
return oa, ErrOauth2NotAssociatedWithUser
}
oa.User, err = GetUserById(oa.Uid)