From b09f491f6206fcd34b03387b948ae1c9436c6f73 Mon Sep 17 00:00:00 2001 From: Chaim Lev Ari Date: Wed, 16 Jan 2019 17:53:10 +0200 Subject: [PATCH] style(auth): remove comments and change error --- api/http/handler/settings/settings_update.go | 2 +- api/oauth/oauth.go | 2 +- .../components/oauth-settings/oauth-settings-controller.js | 0 .../oauth/components/oauth-settings/oauth-settings.js | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js diff --git a/api/http/handler/settings/settings_update.go b/api/http/handler/settings/settings_update.go index 919d8a075..b4ddb9e96 100644 --- a/api/http/handler/settings/settings_update.go +++ b/api/http/handler/settings/settings_update.go @@ -26,7 +26,7 @@ type settingsUpdatePayload struct { func (payload *settingsUpdatePayload) Validate(r *http.Request) error { if *payload.AuthenticationMethod != 1 && *payload.AuthenticationMethod != 2 && *payload.AuthenticationMethod != 3 { - return portainer.Error("Invalid authentication method value. Value must be one of: 1 (internal) or 2 (LDAP/AD)") + return portainer.Error("Invalid authentication method value. Value must be one of: 1 (internal), 2 (LDAP/AD) or 3 (OAuth)") } if payload.LogoURL != nil && *payload.LogoURL != "" && !govalidator.IsURL(*payload.LogoURL) { return portainer.Error("Invalid logo URL. Must correspond to a valid URL format") diff --git a/api/oauth/oauth.go b/api/oauth/oauth.go index d2ceffa55..bafd99443 100644 --- a/api/oauth/oauth.go +++ b/api/oauth/oauth.go @@ -18,7 +18,7 @@ import ( const ( // ErrInvalidCode defines an error raised when the user authorization code is invalid - ErrInvalidCode = portainer.Error("Authorization code is invalid") + ErrInvalidCode = portainer.Error("Invalid OAuth authorization code") ) // Service represents a service used to authenticate users against an authorization server diff --git a/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js b/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/extensions/oauth/components/oauth-settings/oauth-settings.js b/app/extensions/oauth/components/oauth-settings/oauth-settings.js index 9301a0e12..d5031d187 100644 --- a/app/extensions/oauth/components/oauth-settings/oauth-settings.js +++ b/app/extensions/oauth/components/oauth-settings/oauth-settings.js @@ -3,5 +3,4 @@ angular.module('portainer.extensions.oauth').component('oauthSettings', { bindings: { settings: '<' } - // controller: 'oauthSettingsController' });