I’m trying redirect after signing in, except for some paths.
def after_sign_in_path_for(user)
if request.fullpath =~ /some_path/
request.fullpath
elsif # redirect accordingly
# ...
else ...
...
end
end
And it’s doing a redirect loop.
Any ideas?
Figured it out.
It has to do with weird and undocumented behavior of the /users/password/edit path, which is only used for unauthenticated password resets.
Using /users/edit solved this problem.
Had to dig through Devise source code to understand this.