Commit Graph

2126 Commits

Author SHA1 Message Date
Dmitriy
3cb8752317 add missing comma (#79)
Ugh, sorry it took so long to merge this. Thank you!
2019-07-24 04:10:46 +01:00
Dmitry Druganov
93731bbb3b Add option to set trustedIdentity on providers 2018-12-17 22:58:19 +00:00
Kenneth Kwakye-Gyamfi
2807ef3858 Add option to pass a session cookie name 2018-12-17 22:50:49 +00:00
Iain Collins
4aa9b1ed90 Update README 2018-12-05 21:10:42 +00: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
Iain Collins
2cc99479bb Update README 2018-12-04 04:52:38 +00:00
Iain Collins
1a5293ab3c Merge pull request #58 from eu-evops/master
Exposing params in the getProfile call
2018-12-04 04:39:47 +00:00
Iain Collins
61eedb26b0 Merge branch 'master' of github.com:iaincollins/next-auth 2018-11-19 19:12:58 +00:00
Iain Collins
d50c4d8279 Replace npm-shinkrwap with package-lock 2018-11-19 19:12:54 +00:00
Iain Collins
c0fef6e164 Merge pull request #55 from ajaymathur/patch-1
Fixing typo - Thanks @ajaymathur!
2018-11-19 18:06:50 +00:00
Stanislaw Wozniak
aa94cbfdc0 Adding provider params to the insert and update functions 2018-11-12 21:54:07 +00:00
Stanislaw Wozniak
485749c2b1 Exposing params to user defined functions 2018-11-12 21:52:36 +00:00
Stanislaw Wozniak
26f65aad22 Making strategy name consistent
Provider name needs to be consistent between passport.use and passport.authenticate
2018-11-12 21:36:21 +00:00
Stanislaw Wozniak
d1b99170e3 Exposing params in the getProfile call
passport-oauth2 calls back with extra parameters if specified - this is based on the number of arguments passed to the callback function when defining the strategy (https://github.com/jaredhanson/passport-oauth2/blob/master/lib/strategy.js). This change exposes that extra parameter. This is useful if users want to store id_token for instance which is available in the _params object.
2018-11-12 21:11:33 +00:00
Ajay Narain Mathur
e37ed159ad small typo fix 2018-10-29 15:08:56 +11:00
Iain Collins
d9c49b2a0d Merge pull request #51 from aol-nnov/patch-1
case sensitive providerName in passport.authenticate
2018-10-01 22:20:29 +01:00
Iain Collins
7ae354c550 Merge pull request #52 from jenssogaard/master
Added options for bodyParser.json() and bodyParser.urlencoded()
2018-10-01 22:15:27 +01:00
Iain Collins
ba555a83f9 Merge pull request #50 from NickBolles/Add_Types
Add Typescript types by @NickBolles. Not pushing to a new release yet but can't see how it would break anything and I need to catch up with PRs :)

Thanks Nick!
2018-10-01 22:12:52 +01:00
Jens Soegaard
3364db93fa Added the ability to pass options object to bodyParser.json() and bodyParser.urlencoded() 2018-09-27 10:56:51 -04:00
Andrey
c6f58e18bb case sensitive providerName in passport.authenticate
Strategy name in Passoport is not enforced to be all lower case, and it's up to strategy author to pick a name.
So, there's a chance that strategy with mixed case name [exists](https://github.com/exlinc/keycloak-passport/blob/master/index.js#L23)
Without this change such strategies won't work with next-auth.
2018-09-07 21:45:24 +03:00
NickBolles
4686488348 Add sideEffects key 2018-09-06 00:19:42 -05:00
NickBolles
a74af0ec05 Add Typescript Type Definitions 2018-09-06 00:16:24 -05: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
0b869af7a9 Copy changes to inline documentation 2018-08-06 16:16:44 +01:00
Iain Collins
2c57279d09 Merge branch 'master' of https://github.com/iaincollins/next-auth 2018-08-06 16:11:17 +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
2cf673c6d5 Merge pull request #23 from rmcalvert/additional_session_config
Add additional session configuration options
2018-08-06 16:02:09 +01:00
Iain Collins
8895b42448 Improved example documentation and example pages 2018-07-18 20:41:02 -04:00
Iain Collins
f16abbcb18 Publishing 1.9.1 - Updated documentation
Corrects typos and updates Twitter setup instructions.
2018-07-17 18:46:36 -04:00
Iain Collins
f63667754d Merge pull request #33 from 9oelM/master
fix broken link to .env.default because it has been renamed to .env.example
2018-07-17 18:43:21 -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
Joel M
15092f54e5 fix broken link to .env.default because it has been renamed to .env.example 2018-06-13 00:45:10 +00: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
0b1f7b98bb Release 1.8.3
Fixes Webpack config for the latest release of webpack/webpack-cli
2018-05-06 18:28:20 -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
Iain Collins
24885187aa Merge pull request #27 from lifehome/patch-1
Respect configuration file option for setting 'secure' to false in nodemailer via an optional environment variable named EMAIL_SECURE.
2018-05-06 17:38:06 -04:00
Iain Collins
c4f81272d6 Merge pull request #29 from joshuar500/master
Respect strategyOptions.callbackUrl
2018-05-06 17:35:54 -04:00
Josh Rincon
29b03dadea Respect strategyOptions.callbackUrl 2018-04-18 19:53:39 -07:00
lifehome
3883065e1f Respect configuration file 2018-04-05 23:35:03 +08:00
Ryan Calvert
90e3eb9fb0 Add additional session configuration options 2018-03-14 10:18:41 -04: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
cc872701eb Adding LICENCE.txt
Resolves #19
2018-02-13 04:06:41 +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
9c0f61280a Updating README 2018-02-07 17:41:25 +00:00