Devise and Subdomains

Hi,

Having a bit of trouble with Devise and subdomains.

When adding `devise_for` to my routes file, in a subdomain setup, is it recommended to add it globally or within the constraint of a main subdomain, such as “home” or “account”?

I’ve currently put it globally, but when i’m on a subdomain and wishing to sign in, I get taken to `that-subdomain.app.local/users/sign_in` - but it then uses the layout for that subdomain. If someone is signing in then I want my main home layout and all the user stuff in there.

If I move devise_for into a subdomain constraint then things like sign out fail to work due to CORS errors.

Any suggestions or experience putting these two things together?

Anything is possible. From the user perspective, how do you ideally want it to work? That would make it easier to figure out how to configure it.