summaryrefslogtreecommitdiffstats
path: root/model/authorize.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-08-03 12:19:27 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-08-03 13:19:27 -0400
commit5bc3cea6fe4a909735753692d0c4cd960e8ab516 (patch)
tree85715d9fcbc146a9672d84c9a1ea1e96b6e71231 /model/authorize.go
parentea027c8de44d44b6ac4e66ab802e675d315b0be5 (diff)
downloadchat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.tar.gz
chat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.tar.bz2
chat-5bc3cea6fe4a909735753692d0c4cd960e8ab516.zip
PLT-3484 OAuth2 Service Provider (#3632)
* PLT-3484 OAuth2 Service Provider * PM text review for OAuth 2.0 Service Provider * PLT-3484 OAuth2 Service Provider UI tweaks (#3668) * Tweaks to help text * Pushing OAuth improvements (#3680) * Re-arrange System Console for OAuth 2.0 Provider
Diffstat (limited to 'model/authorize.go')
-rw-r--r--model/authorize.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/model/authorize.go b/model/authorize.go
index e0d665bae..2b4017e9c 100644
--- a/model/authorize.go
+++ b/model/authorize.go
@@ -11,6 +11,7 @@ import (
const (
AUTHCODE_EXPIRE_TIME = 60 * 10 // 10 minutes
AUTHCODE_RESPONSE_TYPE = "code"
+ DEFAULT_SCOPE = "user"
)
type AuthData struct {
@@ -71,6 +72,10 @@ func (ad *AuthData) PreSave() {
if ad.CreateAt == 0 {
ad.CreateAt = GetMillis()
}
+
+ if len(ad.Scope) == 0 {
+ ad.Scope = DEFAULT_SCOPE
+ }
}
func (ad *AuthData) ToJson() string {