FROM CACHE - en_header

shopify_app with devise

NileshAjwelkar
Shopify Partner
2 0 0

Hi,

 

We have developed a shopify embedded app, which allows the shopify merchant to install our public app on the store. We have used shopify_app with ruby on rails.

 

We wish to leverage this application and build a admin interface which will allow the admins of the embedded app to log in using email and password, and manage the merchants using who have installed the public app and are using our service. We are using 'devise' gem to handle user sign in, but somehow it does not work. The "current_user" is always nil after logging in. I am not able to figure out the issue. Any help is appreciated.

 

Thanks,

Nilesh Ajwelkar

Replies 4 (4)
SBD_
Shopify Staff
Shopify Staff
1098 146 220

Hey @NileshAjwelkar,

 

The admins, are they logging in via a different path to merchants? E.g. /admin

Have you created the admin users and set up the :authenticate_user! helper?

 

 

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

NileshAjwelkar
Shopify Partner
2 0 0

Hi @SBD_ ,

 

Thank you for the response.

 

Yes. We have a different url "/admin" setup for admin section.

We are allowing admins to signup via "/admin/sign_in".

 

Also, I have a different model "Users" setup for the same.

And, I have all the other things setup as per "devise".

 

Thanks,

Nilesh Ajwelkar

SBD_
Shopify Staff
Shopify Staff
1098 146 220

Interesting. I'm not sure there's much more debugging I can do from this end. Maybe try stripping the app back to just the devise functionality and then slowly work forward to see where it breaks.

Scott | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

FeSens
Tourist
5 0 0

Hello I'm facing the same problem as you. Did you have any advances or tips to share?