Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
@M1sf3t You’re right. I’m also missing rum.
Can you ever hit where it is redirecting without going through sign in procedure?
Seems like a possible two paths that code is taking. One signs in user sets the session. The other yours does what is supposed to but gets bumped out by other route.
It's there any other functions being called right at submit?
@superposition No, but your second point is more likely.
I’m adding a call to my Recaptcha wrapper within a Devise view and controller. I don’t know what Devise does under the hood, or honestly, even how it works. I avoid Devise like the plague because it’s so magical and difficult to use/debug, and invariably a gigantic pain. So I’m assuming that’s actual cause. Devise is probably catching the post, calling the authentication method defined in our application, and then running its own code which then authenticates the user.
But I don’t know how to go about debugging it, either.
The only experience I have with Devise is a) leaving it alone and avoiding it, and b) ripping it out of several applications because the development cost was lower that way.
It was fucking Devise.
It’s intercepting the signin POST, authenticating the user, and only then running the signin method our application defines. It also overrides my redirect somehow. It’s treating our signin method like an “after_signin” hook.
So the solution?
Sign the user out, then redirect.
Bloody fucking Devise.