Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redmine-oauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MyECP
redmine-oauth
Commits
863b2ece
Commit
863b2ece
authored
12 years ago
by
Ilya Kolodnik
Browse files
Options
Downloads
Patches
Plain Diff
add error processing when access denied
parent
69d314b1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/redmine_oauth_controller.rb
+15
-10
15 additions, 10 deletions
app/controllers/redmine_oauth_controller.rb
config/locales/en.yml
+1
-0
1 addition, 0 deletions
config/locales/en.yml
config/locales/ru.yml
+2
-1
2 additions, 1 deletion
config/locales/ru.yml
with
18 additions
and
11 deletions
app/controllers/redmine_oauth_controller.rb
+
15
−
10
View file @
863b2ece
...
...
@@ -14,6 +14,10 @@ class RedmineOauthController < AccountController
end
def
oauth_google_callback
if
params
[
:error
]
flash
[
:error
]
=
l
(
:notice_access_denied
)
redirect_to
signin_path
else
token
=
oauth_client
.
auth_code
.
get_token
(
params
[
:code
],
:redirect_uri
=>
oauth_google_callback_url
)
result
=
token
.
get
(
'https://www.googleapis.com/oauth2/v1/userinfo'
)
info
=
JSON
.
parse
(
result
.
body
)
...
...
@@ -29,6 +33,7 @@ class RedmineOauthController < AccountController
redirect_to
signin_path
end
end
end
def
try_to_login
info
params
[
:back_url
]
=
session
[
:back_url
]
...
...
This diff is collapsed.
Click to expand it.
config/locales/en.yml
+
1
−
0
View file @
863b2ece
en
:
notice_unable_to_obtain_google_credentials
:
"
Unable
to
obtain
credentials
from
Google."
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."
login_via_google
:
"
Login
via
Google"
This diff is collapsed.
Click to expand it.
config/locales/ru.yml
+
2
−
1
View file @
863b2ece
ru
:
notice_unable_to_obtain_google_credentials
:
"
Не
удалось
получить
данные
от
Google."
notice_domain_not_allowed
:
"
Вы
не
можете
войти
в
систему
при
помощи
домена
%{domain}."
notice_access_denied
:
"
Для
корректного
входа
необходимо
разрешить
приложению
доступ
к
аккаунту."
login_via_google
:
"
Войти
с
Google"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment