-
Notifications
You must be signed in to change notification settings - Fork 12
Customizing Routes
Tim Scott edited this page Aug 26, 2017
·
6 revisions
Given that the default value of clientResourceName
is "users", the default auth routes are:
- /users/login
- /users/sign-up/
- /users/confirmation/new
- /users/confirmation
- /users/password/new
- /users/password/edit
You can customize the auth routes:
initReactDevise({
// other config
routes: {
signup: {
component: MyFancySignupForm,
path: '/signup-for-fun-and-profit',
linkText: 'Hey, Signup Now!'
}
}
});
Custom routes are deep merged with the defaults, so you only need to specify the properties you want to change. Say for example you're happy with the default path and link text for the signup route, but you want to use a custom view component:
initReactDevise({
// other config
routes: {
signup: {
component: MyFancySignupForm
}
}
});
This provides a way to replace the built-in views with completely custom views. Similar to server-rendered Devise, it's probably easiest to start with a copy of the built-in views.