Closed ChristianPeters closed 10 years ago
Hi Christian.
Alchemy v2.7.2 does not support using another devise based authentication solution.
Please use Alchemy 3.0 https://github.com/magiclabs/alchemy_cms/tree/master
In Alchemy 3 it is very easy to hook up your own user class and authentication mechanism. See https://github.com/magiclabs/alchemy_cms#authentication-user-model
Could you please use the Google User Group for questions like this? https://groups.google.com/forum/#!forum/alchemy-cms
This is an issue tracker for bug reports.
Thank you and let us know if you need more help
Since you are using a Rails 3.2 app and maybe can not upgrade, please see the https://github.com/magiclabs/alchemy-devise gem.
Maybe this helps with integrating in your app.
The big problem is, that Devise does not support multiple rails engines.
Hey guys,
I need your help. I have spent quite some time on trying to integrate the authentication mechanisms of alchemy and my existing Rails app.
/cms
and the end of the routes file.Then I tested whether the app still works and deleted the session cookie inbetween.
Problem 1 (fixed): Paths of the main app not available
First, I had to prepend all my path helper calls with
main_app.
for all devise controller actions because they were unavailable.Problem 2a: Signing in with a main app user fails
When I try to sign in in the main app, authentication fails (silently) although I am sure about the password:
I guess devise tries to look in the alchemy_users table instead of the users table. Well, the SQL output tells me that it doesn't look there either. Is there a configuration problem?
Problem 2b: Signing in with the Alchemy user fails
Trying to sign in with the first alchemy admin user reveals the same problem – it says "Ungültige Anmeldedaten":
Then I tried to reset my password of the alchemy user...
Problem 3: Devise uses only the Alchemy::User
... and got this error rendering the reset_password_instructions.text.erb:
name_with_salutation
is an instance method of theUser
class from the main app.In search of a clean solution, I found out that you followed the community's wish to decouple Alchemy from devise and extracted the Alchemy user model into its own gem in version 3.0.
As updating my big main app to Rails 4 is no option at this time, I attempted to backport the respective commit to the 2.7-stable branch. The 40-50 merge conflicts were rather straightforward (
current_user
becomescurrent_alchemy_user
and so on) but I had to give up on getting the test suite green.So, what should I do?
Although it's not nicely integrated, I can live with two different authentication scopes. But the separation does not seem to work either.