My app currently only allows the user to sign_in on their subdomain i.e subdomain.domain.com/users/sign_in. I would like the users to login at domain.com/users/sign_in instead.
I'm a Rails newbie and I got a lot of assistance with regards to subdomains from this project on Github: https://github.com/appcasts/saas-timetracker
In routes.rb I added "devise_for :users" to have the sign_in form show at domain.com/users/sign_in, however I'm unable to authenticate the user to the subdomain as I get an "Invalid email and password" error.
Is there a way that users can login from domain.com and be authenticated and redirected to their correct subdomain?
I have tried: How to: Scope login to subdomain
And I get a column "subdomain" does not exist error. I also tried the Custom_Failure_app solution, which kept giving me an error on all redirect_to paths I add.
Any assistance or suggestions will be appreciated.