Commit Graph

19 Commits

Author SHA1 Message Date
Iain Collins
5ad0ace20e Now passes additional option to update
When calling update() after…

1. Invalidating a one time use emailToken (after use).
2. Unlinking an oAuth account.

…it now passes a third option, indicating the property that was deleted from the object (or that should have been):

e.g.

* `functions.update(user, null, { delete: 'emailToken' })`
* `functions.update(user, null, { delete: 'facebook' })`
* `functions.update(user, null, { delete: 'google' })`
* `functions.update(user, null, { delete: 'twitter' })`

This is to make it easier to integrate with databases like Mongoose.

It's needed because if you pass a Mongoose object it will *not let* the key be deleted by NextAuth, so you will have to check for this third pararam in your .update() function and use Mongoose specific commands to unset the field for the user.
2018-02-22 21:39:29 +01:00
Iain Collins
bf3c5fb273 Adding support for credentials based sign in
* Resolves #18 by providing an easy way to define a custom credentials based sign in end point and use it with NextAuth.

The NextAuth client explicitly supports this option and an new example in example/pages/credentials.js shows how to use it (it’s super easy to use and and you can pass any fields you like to it).

Note that this does not explicitly allow a localStrategy to be defined but provides the same ability to define a custom auth hook - allowing custom localStrategies would probably be a footgun and likely generate support requests (as it’s more complicated to implement) so I’m inclined to keep it simple for everyone.

* Resolves #20 by passing the req to email sign in method (useful for things like language and hostname detection).

* If you do not pass a sendSignInEmail() or signIn() functions (or set them to null) then the routes for these will not be created, so that they are easy to disable.
2018-02-18 00:09:15 +01:00
Iain Collins
4960f19d7e Release 1.7.3 - isomorphic-fetch now a dependancy
The module `isomorphic-fetch` is required by `next-auth/client` (but should not be bundled in as the code also needs to run server side, which is why it’s listed an an external in the webpack config).

This update moves the dependancy on it from devDependancies into dependancies, which is where it should be (as is required in production as well). You would already get a warning if you didn’t have it installed, but now you you don’t need to explicitly include it.
2018-02-07 18:33:01 +00:00
Iain Collins
8045a9318a Improving documentation 2018-02-07 17:55:43 +00:00
Iain Collins
b7c30461be Release 1.7.1 fixes bug when not passing a port
This update fixes a bug with initialisation and route handling when not passing a port to NextAuth.
2018-02-07 17:35:30 +00:00
Iain Collins
e98976af04 Changes to response API, fixes issues in 1.6
* Fixes bug in v1.6.0 with the return reponse (for those extending NextAuth), it was returning an empty response after refactoring.
* The instance of Express is now returned in ‘expressApp’, the value ‘express’ now contains Express library being referenced (making it easier to use it for things like creating static routes).
* Removed depdancy for cookie parser (resolves #15).
2018-02-07 16:57:16 +00:00
Iain Collins
ada0568c39 Fix to avoid duplicate sessions in development
Resolves #16
2018-02-07 15:05:52 +00:00
Iain Collins
398c87cf00 Release 1.5.1. - Updaing dependancies
* Example now uses Next.js 5.0.
* Pruned unused dependancies.
* Fixed missing depdendancies for example project.
* Resolved issue with missing dependancies for building the client lib.
2018-02-06 19:20:12 +00:00
Iain Collins
093b1a4524 New release: Version 1.5.0
The major change in this release is integration of next-auth client codebase, so including the next-auth-client module is no longer required.
2018-02-06 19:07:36 +00:00
Iain Collins
54da7ae878 Support for SSL proxies and secure cookies
* Now trust proxies running in front when they say they are running the site over SSL (e.g. Heroku, nginx, AWS, etc).
* Now uses secure cookies on HTTPS enabled sites.
2018-02-05 03:41:40 +00:00
Iain Collins
1450649439 Updating example package version number 2018-02-02 18:04:52 +00:00
Iain Collins
afcae75aaf Now passes oAuth profile to insert() and update()
The oAuth profile for a service is now passed to update() and insert() when signing in via oAuth (or linking accounts).

e.g. `update(user, oAuthProfile)` and `insert(user, oAuthProfile)`

This provides a way to also capture oAuth provider specific fields, such as avatar, location, organisation, etc. as needed.

Thanks to @gielcobben for raising this.
2018-02-02 18:04:13 +00:00
Iain Collins
ff23eba4a4 Updating email config example
Now sends mail directly from localhost if no mail server configured.

This is not recommended for production but can be useful for testing.
2018-01-30 06:25:37 +00:00
Iain Collins
5d28116acc Adding documentation for the example site 2018-01-28 11:05:16 +00:00
Iain Collins
85f5b262c1 Improved documentation and examples 2018-01-28 08:32:19 +00:00
Iain Collins
c2480fde85 Fixing bug with displaying linked accounts
Linked account information was sometimes displayed incorrectly.

This has been fixed, and error handling tightened up to reduce errors.
2018-01-27 15:08:32 +00:00
Iain Collins
803736ad0c Adding documentation 2018-01-27 13:01:02 +00:00
Iain Collins
57df0378f1 Removing build dir
Commited by accident
2018-01-27 12:41:28 +00:00
Iain Collins
a37fc97a60 Initial commit of next-auth and example 2018-01-27 12:37:30 +00:00