Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_api_authentication
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
rails_api_authentication
Commits
e0f1c546
Commit
e0f1c546
authored
Aug 11, 2017
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix oauth relate should auth session
parent
befab240
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
acts_as_authentication_handler.rb
...ails_api_authentication/acts_as_authentication_handler.rb
+1
-1
oauth_session.rb
lib/rails_api_authentication/oauth_session.rb
+3
-9
No files found.
lib/rails_api_authentication/acts_as_authentication_handler.rb
View file @
e0f1c546
...
...
@@ -15,7 +15,7 @@ module RailsApiAuthentication
def
acts_as_oauth_session
(
klass_sym
)
include
RailsApiAuthentication
::
AuthAction
include
RailsApiAuthentication
::
OauthSession
auth_action
klass_sym
,
only:
[
:destroy
]
auth_action
klass_sym
,
only:
[
:
update
,
:
destroy
]
oauth_session
klass_sym
end
...
...
lib/rails_api_authentication/oauth_session.rb
View file @
e0f1c546
...
...
@@ -14,9 +14,9 @@ module RailsApiAuthentication
def
update
@auth_token
=
self
.
class
.
klass
.
oauth_relate
(
se
ssion_relate_params
.
delete
(
:token
)
,
session_
relate_
params
.
delete
(
:oauth_type
),
session_
relate_
params
.
delete
(
:oauth_id
),
se
lf
.
send
(
"current_
#{
self
.
class
.
klass_sym
}
"
)
&
.
token
,
session_params
.
delete
(
:oauth_type
),
session_params
.
delete
(
:oauth_id
),
)
render
json:
{
token:
@auth_token
.
token
},
status:
200
rescue
UserError
=>
e
...
...
@@ -28,12 +28,6 @@ module RailsApiAuthentication
render
json:
{
message:
"logout successful"
},
status:
200
end
def
session_relate_params
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
:oauth_type
,
:oauth_id
,
:token
)
end
def
session_params
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
:oauth_type
,
:oauth_id
)
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