janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
601 stars 40 forks source link

Hotwire Native Support for mobile apps #328

Closed 34code closed 1 hour ago

34code commented 1 hour ago

I'm trying to work around some issues supporting this on a hotwire native iOS app.

Normally my app redirects to "/" after login but this behavior is not good for a tabbed Hotwire native app where it should (ideally) redirect to the tab page path after login..

I'm trying to set login_redirect "/m/profile" in app/misc/rodauth_main.rb conditionally if the user agent is a mobile one... To do this i need to access the "request" object to parse out the user agent and determine if its mobile or not. whats the best way to do this?

34code commented 1 hour ago

nvm i think i figured out how to conditionally redirect to "/" using the controller powering "/m/profile"..