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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1e3fce1a
Commit
1e3fce1a
authored
Jul 10, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for the correct param for token.
parent
4024aa8e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+6
-1
No files found.
app/controllers/application_controller.rb
View file @
1e3fce1a
...
@@ -30,8 +30,13 @@ class ApplicationController < ActionController::Base
...
@@ -30,8 +30,13 @@ class ApplicationController < ActionController::Base
protected
protected
# From https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example
# From https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example
# https://gist.github.com/josevalim/fb706b1e933ef01e4fb6
def
authenticate_user_from_token!
def
authenticate_user_from_token!
user_token
=
params
[
:user_token
].
presence
user_token
=
if
params
[
:authenticity_token
].
presence
params
[
:authenticity_token
].
presence
elsif
params
[
:private_token
].
presence
params
[
:private_token
].
presence
end
user
=
user_token
&&
User
.
find_by_authentication_token
(
user_token
.
to_s
)
user
=
user_token
&&
User
.
find_by_authentication_token
(
user_token
.
to_s
)
if
user
if
user
...
...
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