-
Is it possible to skip certain views such as validation and logout? For Validation: For Logout: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You should be able to do it by routing those requests before the # app/misc/rodauth_app.rb
class RodauthApp < Rodauth::Rails::App
route do |r|
r.get("verify-account") {} # should return 404
r.get("logout") {} # should return 404
r.rodauth
end
end I saw you asked the same question on the Rodauth repo (jeremyevans/rodauth#263), I'm curious what Jeremy will say 🙂 |
Beta Was this translation helpful? Give feedback.
-
I think the simplest way would be to hide the form, and automatically submit it on page load. With Stimulus and Bootstrap, you could implement it as follows: <!-- app/views/rodauth/verify_account.html.erb -->
<%= form_with url: rodauth.verify_account_path, method: :post, data: { turbo: false, controller: "submit" }, class: "d-none" do |form| %>
<!-- ... -->
<% end %> // app/javascript/controllers/submit_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
connect() {
this.element.requestSubmit()
}
} |
Beta Was this translation helpful? Give feedback.
I think the simplest way would be to hide the form, and automatically submit it on page load. With Stimulus and Bootstrap, you could implement it as follows: