Question

I am using Devise to handle registration process.

How can I create a duplicate account via ajax on another site using the same credentials?

I can overwrite Registration controller, but don't know how to get unencrypted password.

Was it helpful?

Solution

You need to override the Devise Registration Controller.

On the create method, get the user input, send it to your other website, then call super to handle registration by devise.

You certainly want to send datas to other website through an API, because of the CSRF protection.

OTHER TIPS

You can't get the unencrypted password.

Devise uses Bcrypt, which a one way encryption algorithm. The only way to get create an exact duplicate is top copy the encrypted password directly, rather than using the unencrypted version.

However I'd strongly recommend against this, what are you trying to achieve? Is there a better way to handle this problem - OAuth?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top