-
Hello. I am starting some web sockets channels for my react application. Obviously I've to secure that connections, so far, the best I could find is using the request session, which looks like this.
I was wondering if there is any better way to ensure that de user is authenticated (two factor too). Thanks!! |
Beta Was this translation helpful? Give feedback.
Answered by
janko
Jan 11, 2023
Replies: 1 comment 1 reply
-
Hi, I have some ideas, but I've never used Action Cable, so I don't know an easy way to test my suggestions. That being said, I believe the following might work: def find_verified_user
if rodauth.authenticated?
rodauth.rails_account
else
reject_unauthorized_connection
end
end
def rodauth
@rodauth ||= RodauthApp.new(env).rodauth
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gaizkaeu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I have some ideas, but I've never used Action Cable, so I don't know an easy way to test my suggestions.
That being said, I believe the following might work: