Commit Graph

2505 Commits

Author SHA1 Message Date
Iain Collins
91f319bc5f Add script to run build after install
This is to temporarily facilitate testing.
2020-05-17 17:45:00 +01:00
Iain Collins
f847488643 Improve error handling in client 2020-05-17 17:45:00 +01:00
Iain Collins
731e227cb6 Update babel config 2020-05-17 17:45:00 +01:00
Iain Collins
f2aafac40c Update formatting in README.md 2020-05-17 17:45:00 +01:00
Iain Collins
5bff4cb07f Add hook, improve client, cookies and docs
* Added React Hook to client.
* NextAuth.session() is now a universal method.
* Improved cookie support, all cookie names and options can be customised (feature request).
* Updated examples in documentation.
2020-05-17 17:45:00 +01:00
Iain Collins
06ef47cc40 Update client and documentation
This is very much a work in progress!
2020-05-17 17:45:00 +01:00
Iain Collins
3e0e4ecb5d Add simple client 2020-05-17 17:45:00 +01:00
Iain Collins
651f3c9887 Improve session and account linking 2020-05-17 17:45:00 +01:00
Iain Collins
cfbe24fc24 Add sessions
While not all signup flows are complete, basic core functionality is now working.

Users can sign in, have their identify verified and session is created for them in a secure manner.

* Added Session model and schema.
* Added createSession and getSessionByID handlers.
 * Added getUserByID handler.
 * Added /api/auth/session endpoint which displays info about the current session.
 * /api/auth/session endpoint is secure as it requires the HTTP only cookie.
 * Remove schema relationship data for now (no value currently and may cause problems if not modeled correctly).
2020-05-17 17:45:00 +01:00
Iain Collins
9432cfda90 Add Preact and PostCSS for pages
We need to be able to return simple server-side rendered pages for authentication (e.g. signin).

Using Preact means we can use JSX in them while keeping depedancy size small.

Ultimately, these pages should be customizable - both by passing in CSS and by specifying custom URL for page.

Additionally, the babel config has been tweaked to reduce bundle size by minifying assets and stripping comments from built assets.
2020-05-17 17:45:00 +01:00
Iain Collins
981adaae24 Update README.md 2020-05-17 17:45:00 +01:00
Iain Collins
ec3da81887 Add option to extend models / use custom models 2020-05-17 17:45:00 +01:00
Iain Collins
d150a7911c Update documentation 2020-05-17 17:45:00 +01:00
Iain Collins
018738bcc0 List files to be published to NPM in package.json 2020-05-17 17:45:00 +01:00
Iain Collins
e37e20faf5 Add babel config for esmodule
This allows next-auth to be imported into Node.js projects.
2020-05-17 17:45:00 +01:00
Iain Collins
4bf13394f1 Add database adapter and models
* Uses typeorm as works with a large number of data stores.
* Compatible with common SQL, document storage & lightweight databases.
* Adapter logic integrated into signup flow but not yet complete.
2020-05-17 17:45:00 +01:00
Iain Collins
3dad0cc849 Apply custom provider options after default
Makes it easier to override options as needed.
2020-05-17 17:45:00 +01:00
Iain Collins
ea69d1e904 Initial commit of signin flow
* Flow not fully complete or tested, but can complete signin journey.
* Does not include source code for adapter (test adapater source currently in client respository while under development).
* Wrapped all calls in promise to avoid early termination of serverless function.
* Callback and Session cookie names and cookie options can now be changed by passing options for them in (feature request from 1.x).
2020-05-17 17:45:00 +01:00
Iain Collins
b666cde7a7 Update README.md and configuration
* Renamed the `serverUrl` configuration variable to `site`.
* Improved cosmetic apperance of place holder sign in page.
2020-05-17 17:45:00 +01:00
Iain Collins
e3784bba9d Initial commit of next-auth 2.0
* Redesigned from the ground up for serverless!
* Doesn't require PassportJS or Express!
* Much simpler configuration!
* Interface exposed via single API endpoint.
* Supports both oAuth 1.x and 2.x services.
* Initial commit includes support for signing in with Twitter, Google and GitHub.

Code is functional, but not useable as adapter support (saving user information) is still in progress.

Still to come:

* Support for Facebook, email, and  credential authentication flows.
* Adapter support - will provide out of the box support for MongoDB, Elasticsearch and SQL with support for writing custom adapters in a similar style to version 1.x.
* Automated User Acceptance Tests for all auth flows.
* Example usage . In a change from version 1.x a demo will exist in a seperate repository to make it easier to get started.
2020-05-17 17:45:00 +01:00
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
dependabot[bot]
a8af12d16b Bump lodash from 4.17.10 to 4.17.15
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.10...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>
2020-05-09 14:40:51 +01:00
Iain Collins
fc8490e64c Update version to 1.13.0
This version will (probably) not be published, at least not until 2.0 ships in the next few weeks.

This release contains several untested fixes and enhancements that were not in the last released version version of 1.x (1.12.1).

I would like to publish it then, so that it can be archived and available to those still using the 1.x branch after release of 2.0.
v1.13.0
2020-05-09 14:32:03 +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
Richard Lewis
ee10fcd37e Allow customisation of session cookie name and sameSite value.
Allow customisation of session cookie name and sameSite value.
2020-05-09 02:28:51 +01:00
Chafik
40d5c25bf1 Fix file name in providers section 2020-05-03 17:41:38 +01:00
Mark Langovoi
f52ccae5a5 Move babel-core and rollup-plugin-babel to dev dependencies (#73) 2019-07-24 04:12:30 +01:00
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