Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
c30f9ad80e7a
Commit
4a6ec7c9
authored
Sep 21, 2017
by
James Lopez
Browse files
refactor some controllers to make them EE friendly
parent
9c5c5a974a01
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/controllers/admin/applications_controller.rb
View file @
c30f9ad8
...
...
@@ -22,8 +22,7 @@ def create
@application
=
Doorkeeper
::
Application
.
new
(
application_params
)
if
@application
.
save
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
admin_application_url
(
@application
)
redirect_to_admin_page
else
render
:new
end
...
...
@@ -42,6 +41,13 @@ def destroy
redirect_to
admin_applications_url
,
status:
302
,
notice:
'Application was successfully destroyed.'
end
protected
def
redirect_to_admin_page
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
admin_application_url
(
@application
)
end
private
def
set_application
...
...
app/controllers/confirmations_controller.rb
View file @
c30f9ad8
...
...
@@ -12,10 +12,14 @@ def after_resending_confirmation_instructions_path_for(resource)
def
after_confirmation_path_for
(
resource_name
,
resource
)
if
signed_in?
(
resource_name
)
after_sign_in
_path_for
(
resource
)
after_sign_in
(
resource
)
else
flash
[
:notice
]
+=
" Please sign in."
new_session_path
(
resource_name
)
end
end
def
after_sign_in
(
resource
)
after_sign_in_path_for
(
resource
)
end
end
app/controllers/oauth/applications_controller.rb
View file @
c30f9ad8
...
...
@@ -21,14 +21,20 @@ def create
@application
.
owner
=
current_user
if
@application
.
save
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
oauth_application_url
(
@application
)
redirect_to_oauth_application_page
else
set_index_vars
render
:index
end
end
protected
def
redirect_to_oauth_application_page
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
oauth_application_url
(
@application
)
end
private
def
verify_user_oauth_applications_enabled
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment