diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-25 11:23:55 -0500 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-25 11:23:55 -0500 |
commit | ea71731f838fc010cfc7511c09875184d1b2396b (patch) | |
tree | 7841e6908a42badb5171760426d2ca5898a76bda /model/authorize.go | |
parent | 6b534f1b0dae2614ec267a82f1c4dc1b096b7b1c (diff) | |
parent | 5478ea34e436109ece417c3704a1fa36d3aba4a5 (diff) | |
download | chat-ea71731f838fc010cfc7511c09875184d1b2396b.tar.gz chat-ea71731f838fc010cfc7511c09875184d1b2396b.tar.bz2 chat-ea71731f838fc010cfc7511c09875184d1b2396b.zip |
merging
Diffstat (limited to 'model/authorize.go')
-rw-r--r-- | model/authorize.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/model/authorize.go b/model/authorize.go index 4176a9b89..e0d665bae 100644 --- a/model/authorize.go +++ b/model/authorize.go @@ -29,35 +29,35 @@ type AuthData struct { func (ad *AuthData) IsValid() *AppError { if len(ad.ClientId) != 26 { - return NewAppError("AuthData.IsValid", "Invalid client id", "") + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.client_id.app_error", nil, "") } if len(ad.UserId) != 26 { - return NewAppError("AuthData.IsValid", "Invalid user id", "") + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.user_id.app_error", nil, "") } if len(ad.Code) == 0 || len(ad.Code) > 128 { - return NewAppError("AuthData.IsValid", "Invalid authorization code", "client_id="+ad.ClientId) + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.auth_code.app_error", nil, "client_id="+ad.ClientId) } if ad.ExpiresIn == 0 { - return NewAppError("AuthData.IsValid", "Expires in must be set", "") + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.expires.app_error", nil, "") } if ad.CreateAt <= 0 { - return NewAppError("AuthData.IsValid", "Create at must be a valid time", "client_id="+ad.ClientId) + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.create_at.app_error", nil, "client_id="+ad.ClientId) } if len(ad.RedirectUri) > 256 { - return NewAppError("AuthData.IsValid", "Invalid redirect uri", "client_id="+ad.ClientId) + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.redirect_uri.app_error", nil, "client_id="+ad.ClientId) } if len(ad.State) > 128 { - return NewAppError("AuthData.IsValid", "Invalid state", "client_id="+ad.ClientId) + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.state.app_error", nil, "client_id="+ad.ClientId) } if len(ad.Scope) > 128 { - return NewAppError("AuthData.IsValid", "Invalid scope", "client_id="+ad.ClientId) + return NewLocAppError("AuthData.IsValid", "model.authorize.is_valid.scope.app_error", nil, "client_id="+ad.ClientId) } return nil |