eddyystop / feathers-service-verify-reset

Adds sign up email verification, forgotten password reset, and other capabilities to local feathers-authentication
MIT License
33 stars 7 forks source link

Verify email REST route not working without client code #2

Closed vgeorge closed 7 years ago

vgeorge commented 8 years ago

At the example the REST route for verifyToken is created by proxying the request via client code. I've incorporated the server code to my app and the module fails to setup a valid GET for token verification via REST. This code defines the route /verifyReset/:action/:value, but it is only acessible via POST requests because it uses create method.

eddyystop commented 8 years ago

Thanks for the info. I'll look into it soon.

eddyystop commented 8 years ago

I'm unclear if you are using Feathers at all on the client. Specifically, are you doing a app.configure(feathers.authentication()) on the client?

The following assumes you are not:

The server-side of this repo lets feathers-authentication (server version) handle the initial authentication.

You can still interface with feathers-authentication (server version) if you are not using Feathersjs on the client. See the authentication over rest section.

You may also consider using something like this on the client:

// <script src="//npmcdn.com/feathers-client@^1.4.1/dist/feathers.js"></script>
const app = feathers()
  .configure(feathers.rest(...))
  .configure(feathers.authentication({ storage: window.localStorage }));

which gives you access to app.authenticate({ type: 'local', email, password }); which let's this repo work as intended. You can use raw HTTP for other all other fetches.

Lemme know what happens.