Skip to content

Use rodauth with specific host #218

Answered by janko
benone asked this question in Q&A
Jul 18, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The r.rodauth call in you Rodauth app's route block is what routes Rodauth endpoints, so you should be able to just wrap a conditional around that code that checks for the hostname through the Roda request object.

# app/misc/rodauth_app.rb
class RodauthApp < Rodauth::Rails::App
  route do |r|
    # ...
    if request.host == "admin.app.com"
      r.rodauth
    end
    # ...
  end
end

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benone
Comment options

Answer selected by benone
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