Closed aaronrenner closed 7 years ago
Putting the value into the session is a bit of a pain. A backdoor would be awesome :D
I've got a proof of concept done for this and will be submitting a PR in the next couple of days.
cool
I'm looking for something like this too. Not sure of the correct way to do this without the Backdoor Middleware... What do people do in the mean time?
@aphillipo Down the bottom of http://blog.overstuffedgorilla.com/simple-guardian/ there's a way to work with session stored tokens. The backdoor middleware will make this dance much simpler.
The example in the blog mentioned above is what I was looking for - would you consider adding that snippet to the docs or readme file?
And although it's slower, I like that method better than the backdoor middleware which uses GET params to setup a fake user - for purposes of testing various routes, you are now no longer testing the exact route (since it has a query string), and there's a chance it conflicts with expected parameters (unlikely, but possible).
@aaronrenner / @hassox — any updates on this functionality and PR #120?
Tracking this in https://github.com/ueberauth/guardian/pull/354
When I'm working in Ruby, I really enjoy how Clearance's Backdoor Middleware allows me to skip the sign in process when writing browser-level acceptance tests. When in my test environment, I can append the
as
query string parameter when I make a request, and I'm automatically signed in as that user. (Here's how I'd make the request using Hound).What would you think about guardian having a middleware that allows developers to be able to skip the sign in process during acceptance tests? To enable this, I was thinking they might add the following to their
web/router.ex
file.I'd be happy to work on this and I'm still thinking over the implementation details, but I wanted to run it by you before I start.