Closed driventv closed 8 years ago
I need to make a couple of changes to allow redirects to a url with ":id" in it. The issue about configuring different redirect pages can be solved by using different roles, but I'll give you more information about that when I've fixed the problem with ":id" urls (some time later this week).
On the current master branch, you can now redirect to urls with ":id" in them (the hex package has not been updated yet).
I think the problem you described can be solved by using different user roles depending on if the user has added a profile or not.
So, your redirect_pages map would contain %{"newuser" => "/profile/new", "user" => "/profile/:id"}
. Then, when you first register the user, you give him / her the "newuser" role. After the user has created the profile, you can then change his / her role to "user" (you can do this when you update the profile).
Let me know if you have any further questions, problems, etc.
Hey David, I am trying to configure the redirects that occur upon a successful login and registration. For context, my app has user profiles. When they first register, I want them redirected to http://app/profiles/new so they can initially create their profile. But, once they create it, when they log in, I want them redirected to their specific profile page as in http://app/profiles/show/:id. I see that I can configure basic redirects such as "admin" => "/admin", but I need more customization in where users are redirected to. I guess I could configure a basic redirect, then have that route redirect again to the profile page, but I wanted to see if you knew an easier way this could be done within the config.exs file.