-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current user from channel. #760
Comments
Something like this: def find_verified_user
ApplicationRecord.connection_pool.with_connection do |conn|
headers = JSON.parse(cookies['auth_headers'] || '{}')
uid = headers['uid']
token = headers['access-token']
client_id = headers['client']
return nil unless token
user = uid && User.find_by_uid(uid)
if user && user.valid_token?(token, client_id)
user
end
end
end |
Thanks @merqlove. I have similar issue but with multitenancy (apartment gem). Have a experience with this situation? |
@brunowego it's different question kind, but I think you can run dta as shared service, and check tokens/session per tenant. |
Possible solutions posted (Thanks @merqlove ), closing for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
How I can get current_user from channel?
I am using angularjs with ng-token-auth.
Thanks.
The text was updated successfully, but these errors were encountered: