36 Commits

Author SHA1 Message Date
dependabot[bot]
6eec05567d Bump lodash from 4.17.11 to 4.17.15 in /example
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2020-05-09 17:32:24 +01:00
dependabot[bot]
556f4ff2ce Bump mixin-deep from 1.3.1 to 1.3.2 in /example
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-05-09 14:41:04 +01:00
ndo@ndo1
b126fcc737 update: index.js dotenv fix 2020-05-09 02:30:57 +01:00
ndo@ndo1
83cd2d1883 fix: dotenv loading 2020-05-09 02:30:57 +01:00
Iain Collins
71bc1a9e9e Update comments 2018-12-05 21:09:02 +00:00
Iain Collins
84e43d0630 Release 1.12.1; improve compatibility, fix session save bug; update dependancies
* All dependancies updated, including the example to include latest release of Next.js and React.
* Includes fix for Keycloak strategy support and improved oAuth strategy compatibility.
* Includes enhancement for exposing additional parameters when calling getProfile().
* `sessionResave` now defaults to `true`, which ensures sessions always rotate properly.

This can be disabled for special use cases - it does not work well with some Express Session Stores, but for most people it should be fine and should rotate sessions correctly. If set to `false` user sessions are likely to expire prematurely. It is strongly recommended you do not change this from the default setting.

As a side effect, this will case all sessions - including anonymous sessions created when users have connected but not logged in yet - to be saved as a session in the store. This is because the current Cross Site Request Forgery option associates a token with a session in the browser.

If you want to avoid creating anonymous sessions,  set `csrf` to `false` to disable CSRF protection;  sessions will then only be created when a user signs in. A future update should include the option to implement CSRF using the Double Submit Cookie method so it can be enabled without causing this side effect.
2018-12-04 05:03:12 +00:00
Ajay Narain Mathur
e37ed159ad small typo fix 2018-10-29 15:08:56 +11:00
Iain Collins
e83c77f6de Release 1.11.0 - Internet Explorer 11 support
* Added Babel Pollyfill to the next-auth client and rollup config.
* Client longer relies on ES6 features and so works in Internet Explorer (support for which had been dropped was was conflicting with newerver version of webpack when building isomorphic libraries).
* Example client now has slightly better example of how to handle the callback screen for browsers that don’t have JavaScript enabled.
2018-08-25 17:25:08 +01:00
Iain Collins
50c5613fed Updating copy on error page
Improving copy for readability.

Still needs a bit of work to make it easier to parse.
2018-08-11 16:54:39 +01:00
Iain Collins
4018b7309e * The CSRF can now be true (default), false or a custom object for lusca.
You can use a custom object to define paths to white list or set it to `false` if you don't want CSRF protection (or want to apply your own).

* Refactored session support to custom session objects to be returned to clients.
2018-08-06 16:08:54 +01:00
Iain Collins
8895b42448 Improved example documentation and example pages 2018-07-18 20:41:02 -04:00
Iain Collins
0ce832a4f7 Merge pull request #34 from rahls7/patch-1
Fixed a typo in run locally command
2018-07-17 18:42:16 -04:00
Iain Collins
2f7b68f352 Release 1.9.0 - Migrated rollup from webpack
* Migrated to rollup from webpack, as webpack no longer generates working isomorphic code in latest versions.

* The webpack generated client was also causing an error in Internet Explorer 11 (Microsoft Edge was and still is working fine).

* There are _still_ breaking issues in Internet Explorer 11 with the example project (cause TBD), but it no longer crashes the app, so fallback of server side rendering still works.
2018-07-17 17:54:32 -04:00
Rahul
45c732060d Fixed a typo in run locally command 2018-06-19 20:01:16 -04:00
Iain Collins
f32ce7b7ed Release 1.8.5
* Hotifx for release 1.8.3 which was a broken release (!)
* This release includes a downgrade from webpack 4.7 to webpack 3.11 (the latest release of 3.x)
* Example upgraded to latest versions of Next.js 6.0 and React/React DOM 16.3

The downgrade of webpack is due to breaking changes in webpack. Webpack 4.7 builds do not work as universal builds (that can run in web, webworker and node.js).

There is no fix or apparent workaround for this in webpack presently, but a fix has been suggested in an issue linked to in this thread: https://github.com/webpack/webpack/issues/6525
2018-05-06 19:43:01 -04:00
Iain Collins
64703ef4f1 Bumping version for 1.8.2 release
* Now respects 'callbackUrl' in 'strategyOptions' for oAuth providers.
* Updated dependancy versions

Resolves #25 thanks to @joshuar500
2018-05-06 18:20:03 -04:00
lifehome
3883065e1f Respect configuration file 2018-04-05 23:35:03 +08:00
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