Part 2: Adding Guardian Authentication
Now we're going to add authentication to our app. As this is going to be a JSON REST API we are g...
For further actions, you may consider blocking this person and/or reporting abuse
This is great. Thanks to the github repo I got all tests validated. One thing: the seeded user token never seems to successfully delete:
passing in the token on the seeded user always fails(
401
). However, if I create a new user with:and then I call
DELETE /api/sessions
whilst passing in the correct token, I get204
. So it appears ok on new users.Hi Michael, I just tried and I had no problems at all loggin in the seeded user and then loggin it out.
Are you sure that in the delete curl command, you used a valid token that you got from the loggin cur action. Maybe you used the one from my example?
Cheers
Finally got back to this. Yes, that was the problem.
I'm trying to execute the tests for session_controller but in my terminal is loggin out:
undefined function create_user/1
I think this is because the statement
setup["create_user"]
in somehow is not found out by the test engine. How can I fix it?Is it really good idea to allow anyone to create new real users?
This feature allows users to signup to the app. Ideally we would offer also the option to signup with google/facebook/etc.
Or provide some kind of user-assisted account confirmation.
Yes, that's correct. For this tutorial an email confirmation or any other type of user signup improvement is out of scope.
Ok. I agree.
Maybe just add a notice about such an assumption? Just for clarification.
Sure