-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verification e-mail can be bypassed via REST #9
Comments
Could you provide the |
Sorry, I have to go, but here's what Postman would give me: POST /users HTTP/1.1 name=i+have+a+name&username=nammmmmmmmmmme&password=what+the+hey&confirmPassword=what+the+hey&email=yes%40no.why and then: POST /auth/local HTTP/1.1 email=yes%40no.why&password=what+the+hey |
In my rush I didn't realize it was only one more click away. Oops. So, here are the curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -H "Postman-Token: 95cf199c-f038-c893-7053-a8a09fbef2ca" -d 'name=i have a name&username=nammmmmmmmmmme&password=what the hey&confirmPassword=what the hey&[email protected]' "http://localhost:3030/users"
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 018a022f-bf1b-7e4f-cf11-db40a5fce490" -d '[email protected]&password=what the hey' "http://localhost:3030/auth/local" |
The HTTP REST request goes straight to I'm sorry but I think you have to take it there. You need to mention that its with v0.7. |
OK will do. Thanks! |
Er, wait. I would actually expect this behaviour (exposing a JWT and letting you log in) but only in the case that the user has already verified their e-mail. That feature is specific to this starter, so doesn't that make it an issue only applicable here? |
"If you use Postman to POST a valid (but not yet email-verified) set of
email and password values to /auth/local with the header Accept:
application/json, you get back a verifyToken. Without the header you get an
HTML response that says you've successfully logged in."
The repo server uses only `app.configure(authentication);`.
The repo client (which is not involved in this issue) is a websocket client
using `feathers-reduxify-authentication` which uses `app.authenticate()`
and `app.logout()`. So the repo doesn't directly handle the headers.
The repo design uses a `isVerfied` flag which `feathers-authenticate`
doesn't know about. The version of `feathers-service-verify-reset` brought
into feathers core uses the same design.
Since this seems to be an issue with headers, HTTP REST and perhaps
`feathers-authenticate` design. So I think that's were the answer lies.
|
I don't think there's anything wrong with the headers per se: if I'm looking for JSON I get JSON back, and if not, I get HTML. That's great. The thing is, neither the JSON nor the HTML should report a successful login, since I've never verified my e-mail. I think I named this a bit poorly...I guess it doesn't matter about the JWT, it's more that it lets you log in without verifying your e-mail. |
If you use Postman to POST a valid (but not yet email-verified) set of email and password values to
/auth/local
with the headerAccept: application/json
, you get back a response that includes theverifyToken
. Without the header you get an HTML response that says you've successfully logged in.This is in dev mode (haven't tried the production windows patch yet) so hopefully this isn't here in production, as it allows someone to bypass the email verification step.
The text was updated successfully, but these errors were encountered: