Skip to content

Skip Rodauth GET routes #162

Answered by janko
shafiqapandi asked this question in Q&A
Sep 27, 2022 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

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()
  }
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@shafiqapandi
Comment options

@janko
Comment options

@shafiqapandi
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by shafiqapandi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #161 on September 27, 2022 07:38.