diff --git a/app/controllers/redmine_oauth_controller.rb b/app/controllers/redmine_oauth_controller.rb index 556cfb3..e9ff3ab 100644 --- a/app/controllers/redmine_oauth_controller.rb +++ b/app/controllers/redmine_oauth_controller.rb @@ -22,13 +22,8 @@ class RedmineOauthController < AccountController token = oauth_client.auth_code.get_token(params[:code], :redirect_uri => oauth_a2_callback_url) result = token.get(Setting.plugin_redmine_oauth2_a2[:a2_server_url] + '/idp/oauth2/user-info/') info = JSON.parse(result.body) - if info && info["verified_email"] - if allowed_domain_for?(info["email"]) + if info try_to_login info - else - flash[:error] = l(:notice_domain_not_allowed, :domain => parse_email(info["email"])[:domain]) - redirect_to signin_path - end else flash[:error] = l(:notice_unable_to_obtain_a2_credentials) redirect_to signin_path diff --git a/config/locales/en.yml b/config/locales/en.yml index b101fd6..e15ee9a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,5 +1,4 @@ en: notice_unable_to_obtain_a2_credentials: "Unable to obtain credentials from Authentic." - notice_domain_not_allowed: "You can not login using %{domain} domain." - notice_access_denied: "You must allow to use you Google credentials to enter this site." + notice_access_denied: "You must allow Authentic to use your credentials to enter this site." login_via_oauth2_a2: "Login via Authentic using OAuth2" diff --git a/config/locales/ru.yml b/config/locales/ru.yml deleted file mode 100644 index 44d1235..0000000 --- a/config/locales/ru.yml +++ /dev/null @@ -1,5 +0,0 @@ -ru: - notice_unable_to_obtain_a2_credentials: "Не удалось получить данные от Authentic." - notice_domain_not_allowed: "Вы не можете войти в систему при помощи домена %{domain}." - notice_access_denied: "Для корректного входа необходимо разрешить приложению доступ к аккаунту." - login_via_a2: "Войти с Authentic"