-
Notifications
You must be signed in to change notification settings - Fork 62
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 when not using Devise #10
Comments
hello, in fact we do not use devise, however we thought that many
integrations of this library would. In general, authentication libraries
have a helper method called current_user. therefore it's integration into
this library is given by the injection of that helper into policy manager
application controller, as it is in the readme example. I think that is the
easiest way to integrate it. Do you have any idea on how to make that
integration simpler or more elegant? If so, we will glad to discuss it's
design
Best!
El lun., 7 de may. de 2018 2:27 p. m., sapientpants <
[email protected]> escribió:
… Any thoughts as to how current_user should be made available when Devise
(and hence its helper that generates current_user) isn't being used?
I'm happy to work on this, but wanted to ask if anyone has an idea for how
this should be done.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAuyGUuUD-QzDvwYYffP9YRkWSkNMriks5twIQcgaJpZM4T1Vnz>
.
|
Off the top of my head I can think of two approaches.
I include option 2 for completeness as it seems even less elegant than option 1 which itself is not particularly nice. It'd be nice if GDPR could just use current_user from my ApplicationController without me having to do anything extra. |
This is also a problem for Devise users that use a model other than User for authentication. If you're authenticating a Person, for example, Devise creates current_person instead of current_user. I've worked around this by creating a controller concern (app/controllers/concerns/auth_helpers.rb):
and I include this in the PolicyManager ApplicationController (in config/initializers/gdpr.rb):
|
Any thoughts as to how current_user should be made available when Devise (and hence its helper that generates current_user) isn't being used?
I'm happy to work on this, but wanted to ask if anyone has an idea for how this should be done.
The text was updated successfully, but these errors were encountered: