diff options
author | skyblue <ssx205@gmail.com> | 2014-04-12 23:19:17 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-04-12 23:19:17 +0800 |
commit | 2ce0c3befef3becd48660e600ef70e8affd5bc7c (patch) | |
tree | 7d50fb40cec6fc255acac7b0dbfa238d59b389bf /models | |
parent | 5d30bfc8baa1f012e6ac52b450915250be080815 (diff) | |
download | gitea-2ce0c3befef3becd48660e600ef70e8affd5bc7c.tar.gz gitea-2ce0c3befef3becd48660e600ef70e8affd5bc7c.zip |
add google oauth2 support
Diffstat (limited to 'models')
-rw-r--r-- | models/oauth2.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/oauth2.go b/models/oauth2.go index c5d58c0749..e28b00870f 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -26,7 +26,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 +48,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) |