summaryrefslogtreecommitdiffstats
path: root/app/authentication.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-02-06 17:25:49 -0600
committerGitHub <noreply@github.com>2018-02-06 17:25:49 -0600
commit1ec295f88ca99e9423ffd91019cecf802ae3dc77 (patch)
tree05abc364fefdc6b1088bfb4a307ba11db0dc427f /app/authentication.go
parent034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff)
downloadchat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.gz
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.tar.bz2
chat-1ec295f88ca99e9423ffd91019cecf802ae3dc77.zip
add App.License, remove utils.IsLicensed / utils.License calls (#8203)
Diffstat (limited to 'app/authentication.go')
-rw-r--r--app/authentication.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/authentication.go b/app/authentication.go
index 0b3659449..5c91f8038 100644
--- a/app/authentication.go
+++ b/app/authentication.go
@@ -36,7 +36,7 @@ func (tl TokenLocation) String() string {
}
func (a *App) IsPasswordValid(password string) *model.AppError {
- if utils.IsLicensed() && *utils.License().Features.PasswordRequirements {
+ if license := a.License(); license != nil && *license.Features.PasswordRequirements {
return utils.IsPasswordValidWithSettings(password, &a.Config().PasswordSettings)
}
return utils.IsPasswordValid(password)
@@ -150,7 +150,7 @@ func (a *App) CheckUserPostflightAuthenticationCriteria(user *model.User) *model
}
func (a *App) CheckUserMfa(user *model.User, token string) *model.AppError {
- if !user.MfaActive || !utils.IsLicensed() || !*utils.License().Features.MFA || !*a.Config().ServiceSettings.EnableMultifactorAuthentication {
+ if license := a.License(); !user.MfaActive || license == nil || !*license.Features.MFA || !*a.Config().ServiceSettings.EnableMultifactorAuthentication {
return nil
}
@@ -183,7 +183,8 @@ func checkUserNotDisabled(user *model.User) *model.AppError {
}
func (a *App) authenticateUser(user *model.User, password, mfaToken string) (*model.User, *model.AppError) {
- ldapAvailable := *a.Config().LdapSettings.Enable && a.Ldap != nil && utils.IsLicensed() && *utils.License().Features.LDAP
+ license := a.License()
+ ldapAvailable := *a.Config().LdapSettings.Enable && a.Ldap != nil && license != nil && *license.Features.LDAP
if user.AuthService == model.USER_AUTH_SERVICE_LDAP {
if !ldapAvailable {