paths.rdoc

doc/guides/paths.rdoc
Last Update: 2020-06-30 15:06:09 -0700

Change route path

You can change the URL path of any Rodauth route by overriding the corresponding *_route method:

plugin :rodauth do
  enable :login, :logout, :create_account, :reset_password

  # Change login route to "/signin"
  login_route "signin"

  # Change create account route to "/register"
  create_account_route "register"

  # Change password reset request route to "/reset-password/request"
  reset_password_request_route "reset-password/request"
end

If you want to add a prefix to all Rodauth routes, you should use the prefix setting:

plugin :rodauth do
  enable :login, :logout

  # Use /auth prefix to each Rodauth route
  prefix "/auth"
end

route do |r|
  r.on "auth" do
    # Serve Rodauth routes under the /auth branch of the routing tree
    r.rodauth
  end

  # ...
end