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
55087b6a
Commit
55087b6a
authored
Aug 08, 2017
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix auth code login bug
parent
3fff1e87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
auth_session.rb
lib/rails_api_authentication/auth_session.rb
+9
-10
authable.rb
lib/rails_api_authentication/authable.rb
+2
-2
oauth_session.rb
lib/rails_api_authentication/oauth_session.rb
+3
-4
No files found.
lib/rails_api_authentication/auth_session.rb
View file @
55087b6a
...
@@ -19,17 +19,16 @@ module RailsApiAuthentication
...
@@ -19,17 +19,16 @@ module RailsApiAuthentication
render
json:
{
message:
"logout successful"
},
status:
200
render
json:
{
message:
"logout successful"
},
status:
200
end
end
private
def
session_params
def
session_params
auth_key
=
self
.
class
.
klass
.
auth_key
auth_key
=
self
.
class
.
klass
.
auth_key
auth_password
=
self
.
class
.
klass
.
auth_password
auth_password
=
self
.
class
.
klass
.
auth_password
oauth_enable
=
self
.
class
.
oauth_enable
oauth_enable
=
self
.
class
.
oauth_enable
if
oauth_enable
if
oauth_enable
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
auth_key
,
auth_password
,
:oauth_type
,
:oauth_id
)
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
auth_key
,
auth_password
,
:oauth_type
,
:oauth_id
)
else
else
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
auth_key
,
auth_password
)
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
auth_key
,
auth_password
)
end
end
end
end
module
ClassMethods
module
ClassMethods
attr_reader
:klass
,
:klass_sym
attr_reader
:klass
,
:klass_sym
...
...
lib/rails_api_authentication/authable.rb
View file @
55087b6a
...
@@ -43,8 +43,8 @@ module RailsApiAuthentication
...
@@ -43,8 +43,8 @@ module RailsApiAuthentication
valid_for
params
.
merge
(
{
key:
@auth_key
}
)
valid_for
params
.
merge
(
{
key:
@auth_key
}
)
end
end
def
oauth_for
def
oauth_for
params
=
{}
@oauth_enable
=
params
[
:enable
]
||
fals
e
@oauth_enable
=
params
[
:enable
]
||
tru
e
@oauth_only
=
params
[
:only
]
||
false
@oauth_only
=
params
[
:only
]
||
false
end
end
...
...
lib/rails_api_authentication/oauth_session.rb
View file @
55087b6a
...
@@ -17,10 +17,9 @@ module RailsApiAuthentication
...
@@ -17,10 +17,9 @@ module RailsApiAuthentication
render
json:
{
message:
"logout successful"
},
status:
200
render
json:
{
message:
"logout successful"
},
status:
200
end
end
private
def
session_params
def
session_params
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
:oauth_type
,
:oauth_id
)
params
.
require
(
self
.
class
.
klass_sym
).
permit
(
:oauth_type
,
:oauth_id
)
end
end
module
ClassMethods
module
ClassMethods
attr_reader
:klass
,
:klass_sym
attr_reader
:klass
,
:klass_sym
...
...
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