Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
7fe8d41d
Commit
7fe8d41d
authored
Dec 25, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve code style
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
a61ccd4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
app/controllers/oauth/applications_controller.rb
app/controllers/oauth/applications_controller.rb
+10
-4
app/controllers/oauth/authorizations_controller.rb
app/controllers/oauth/authorizations_controller.rb
+6
-5
app/controllers/oauth/authorized_applications_controller.rb
app/controllers/oauth/authorized_applications_controller.rb
+2
-2
No files found.
app/controllers/oauth/applications_controller.rb
View file @
7fe8d41d
...
...
@@ -8,7 +8,11 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
def
create
@application
=
Doorkeeper
::
Application
.
new
(
application_params
)
@application
.
owner
=
current_user
if
Doorkeeper
.
configuration
.
confirm_application_owner?
if
Doorkeeper
.
configuration
.
confirm_application_owner?
@application
.
owner
=
current_user
end
if
@application
.
save
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:create
])
redirect_to
oauth_application_url
(
@application
)
...
...
@@ -18,8 +22,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
end
def
destroy
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:destroy
])
if
@application
.
destroy
if
@application
.
destroy
flash
[
:notice
]
=
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:applications
,
:destroy
])
end
redirect_to
profile_account_url
end
end
\ No newline at end of file
end
app/controllers/oauth/authorizations_controller.rb
View file @
7fe8d41d
...
...
@@ -27,9 +27,9 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
private
def
matching_token?
Doorkeeper
::
AccessToken
.
matching_token_for
pre_auth
.
client
,
current_resource_owner
.
id
,
pre_auth
.
scopes
Doorkeeper
::
AccessToken
.
matching_token_for
(
pre_auth
.
client
,
current_resource_owner
.
id
,
pre_auth
.
scopes
)
end
def
redirect_or_render
(
auth
)
...
...
@@ -41,7 +41,8 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
end
def
pre_auth
@pre_auth
||=
Doorkeeper
::
OAuth
::
PreAuthorization
.
new
(
Doorkeeper
.
configuration
,
@pre_auth
||=
Doorkeeper
::
OAuth
::
PreAuthorization
.
new
(
Doorkeeper
.
configuration
,
server
.
client_via_uid
,
params
)
end
...
...
@@ -51,7 +52,7 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
end
def
strategy
@strategy
||=
server
.
authorization_request
pre_auth
.
response_type
@strategy
||=
server
.
authorization_request
(
pre_auth
.
response_type
)
end
end
app/controllers/oauth/authorized_applications_controller.rb
View file @
7fe8d41d
...
...
@@ -2,7 +2,7 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
layout
"profile"
def
destroy
Doorkeeper
::
AccessToken
.
revoke_all_for
params
[
:id
],
current_resource_owner
Doorkeeper
::
AccessToken
.
revoke_all_for
(
params
[
:id
],
current_resource_owner
)
redirect_to
profile_account_url
,
notice:
I18n
.
t
(
:notice
,
scope:
[
:doorkeeper
,
:flash
,
:authorized_applications
,
:destroy
])
end
end
\ No newline at end of file
end
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