From b013f02209c7c128a35d1c54f2d4a7d6a9701f72 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 13 Jan 2016 14:58:49 -0800 Subject: Added ability to sign in via username; separated email sign in and sign up config settings --- model/config.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'model/config.go') diff --git a/model/config.go b/model/config.go index 5c8604ff1..a6d1c21dc 100644 --- a/model/config.go +++ b/model/config.go @@ -97,6 +97,8 @@ type FileSettings struct { type EmailSettings struct { EnableSignUpWithEmail bool + EnableSignInWithEmail *bool + EnableSignInWithUsername *bool SendEmailNotifications bool RequireEmailVerification bool FeedbackName string @@ -258,6 +260,21 @@ func (o *Config) SetDefaults() { *o.TeamSettings.EnableTeamListing = false } + if o.EmailSettings.EnableSignInWithEmail == nil { + o.EmailSettings.EnableSignInWithEmail = new(bool) + + if o.EmailSettings.EnableSignUpWithEmail == true { + *o.EmailSettings.EnableSignInWithEmail = true + } else { + *o.EmailSettings.EnableSignInWithEmail = false + } + } + + if o.EmailSettings.EnableSignInWithUsername == nil { + o.EmailSettings.EnableSignInWithUsername = new(bool) + *o.EmailSettings.EnableSignInWithUsername = false + } + if o.EmailSettings.SendPushNotifications == nil { o.EmailSettings.SendPushNotifications = new(bool) *o.EmailSettings.SendPushNotifications = false -- cgit v1.2.3-1-g7c22