Commit 0bdede66 by liyijie

Add auth to current_authable after auth!

parent e0f1c546
......@@ -5,7 +5,7 @@ module RailsApiAuthentication
DIGEST = Digest::SHA2.new
included do
attr_accessor :token
attr_accessor :token, :auth
def logout
AuthToken.find(token: token)&.first&.delete if token.present?
......@@ -151,6 +151,7 @@ module RailsApiAuthentication
else
user = self.find_by(id: auth.oid)
user.token = auth.token
user.auth = auth
user
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment