-
Hi! I have two hostnames:
I need to use authentication (routes etc) only on admin.app.com How can I set up this? |
Beta Was this translation helpful? Give feedback.
Answered by
janko
Jul 18, 2023
Replies: 1 comment 1 reply
-
The # app/misc/rodauth_app.rb
class RodauthApp < Rodauth::Rails::App
route do |r|
# ...
if request.host == "admin.app.com"
r.rodauth
end
# ...
end
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
benone
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
r.rodauth
call in you Rodauth app'sroute
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.