// Test that go1.2 tag above is included in builds. main.go refers to this definition.
const go12tag = true
--const APP_VER = "0.2.2.0408 Alpha"
++const APP_VER = "0.2.2.0409 Alpha"
func init() {
base.AppVer = APP_VER
}
func GetOauth2(identity string) (oa *Oauth2, err error) {
- oa = &Oauth2{}
- oa.Identity = identity
- exists, err := orm.Get(oa)
+ oa = &Oauth2{Identity: identity}
+ isExist, err := orm.Get(oa)
if err != nil {
return
- }
- if !exists {
+ } else if !isExist {
return nil, ErrOauth2RecordNotExists
- }
- if oa.Uid == 0 {
+ } else if oa.Uid == 0 {
return oa, ErrOauth2NotAssociatedWithUser
}
- return GetUserById(oa.Uid)
+ oa.User, err = GetUserById(oa.Uid)
- return
++ return oa, err
}