Is it possible to rename the endpoints of a subsite in Yesod?
For instance, instead of using the provided /login or /email/register from yesod-auth, I want to call them "/entrar" and "/cadastrar" (their PT-BR counterparts, respectively).
The only way I managed to do that was by setting my stack.yaml
to use a modified local copy of yesod-auth
, but I wonder if there's a better approach.
Currently the YesodAuth
datatype doesn't provide a way to change those routes, so you have two options as far as I know:
Have a local copy of yesod-auth
and modify it according to your needs (What you're doing right know)
Have the routes you want in config/routes
and a handler for each of them that will redirect to the yesod-auth
routes:
config/routes
/entrar MyauthEntrarR GET
src/Handler/Myauth
getMyauthEntrar :: Handler Html
getMyauthEntrar = redirect LoginR
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With