Replies: 2 comments 3 replies
-
|
Is nobody else having problems with this behaviour? I can work around it partially by using Turbo drive which handles it correctly, but for example the opening screen of my app might return unauthorized with the login form, but that just shows a big error screen like above instead of the sign in form. |
Beta Was this translation helpful? Give feedback.
-
|
Regular forms should work as expected by default and you can tell devise to use 200 and 302 status codes on login. The demo has a nice example for this, you can try it out by running the demo app based on the readme: https://github.com/hotwired/hotwire-native-android/tree/main/demo The following page will be loaded in the Android app: https://hotwire-native-demo.dev/resources/new For Devise, I could get it wokring by commenting out the # config/initializers/devise.rb
# ==> Hotwire/Turbo configuration
# When using Devise with Hotwire/Turbo, the http status for error responses
# and some redirects must match the following. The default in Devise for existing
# apps is `200 OK` and `302 Found` respectively, but new apps are generated with
# these new defaults that match Hotwire/Turbo behavior.
# Note: These might become the new default in future versions of Devise.
# config.responder.error_status = :unprocessable_entity (COMMENT THIS OUT)
# config.responder.redirect_status = :see_other (COMMENT THIS OUT) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With Devise I get a 422 response code back on wrong password. In normal browsers I also see the body of that response. On Hotwire Native however I get this screen and the user can't do anything with it anymore:
How can I disable this behaviour and better emulate a normal browser?
Beta Was this translation helpful? Give feedback.
All reactions