Commit Graph

2455 Commits

Author SHA1 Message Date
Iain Collins
bbfeac408e Document SQL for MySQL and Postgres
These match up exactly with the models generated by TypeORM in v3 and are suitable for use with Prisma.
2020-07-27 05:20:34 +01:00
Iain Collins
364de1fc6c Update MySQL Model in TypeORM to use TIMESTAMP(6)
An issue with the defaults for MySQL used by TypeORM Adapter has been highlighted during testing parity with the Prisma Adapter.

This change ensures *all* TIMESTAMP columns use TIMESTAMP(6) to store six digits of precision after the number of seconds.

While this is level of precision is not required everywhere it ensures all timestamps in the default models use the same configuration (instead of a mix of values) and is consisitant with the level of precision on timestamps used Postgres.
2020-07-27 05:20:34 +01:00
Iain Collins
52af06cd33 Add Prisma client to optional peer dependencies
This doesn't technically do anything (except for the mongodb peer dependancy, which is invoked when a mongodb is being used) but it provides a way for us to indicate and track the last known good versions of database clients for NextAuth.js.
2020-07-27 05:20:34 +01:00
Iain Collins
8f472c5987 Prisma adapter refactor 2020-07-27 05:20:34 +01:00
Iain Collins
dcbd7a6703 Improve TypeORM adapter (#460)
* Uses `require_optional` and `peerOptionalDependencies` instead of dynamic import to resolve issue some users have experience with using using compliers/bundlers (especially on starter projects) that don't handle dynamic imports well.

This should (hopefully) also make it easier to support older versions of Internet Explorer by avoiding bundlers that choke on dynamic imports unless MongoDB is included as a dependancy (even though it's not code they need to compile).

We use `require_optional` to load `ObjectID` conditionally, if NextAuth.js is using MongoDB. This is also exactly how the MongoDB driver itself loads the ObjectID from the `bson/bson-ext` module.

Should resolve #251
    
* The default name for the TypeORM connection is now 'nextauth' instead of 'default'.

This should help people avoid problems with connection re-use when not using serverless (including in local development), especially if they are doing things with their default connection that differ from whats expected by NextAuth.js (like not using UTF-8 for encoding or UTC timezones).

* Now uses connection manager object from the connection, to allow a custom TypeORM connection name to be specified (resolves #459).
2020-07-27 05:20:34 +01:00
Iain Collins
e6fd4c2edc Improve sidebar apperance 2020-07-27 05:20:34 +01:00
Iain Collins
e19ca19a82 Add tips to provider documentation 2020-07-27 05:20:34 +01:00
Iain Collins
7b1b68e1c4 Fix typos in tutorial code 2020-07-27 05:20:34 +01:00
Iain Collins
56d848c868 Fix return type of sign in callback in docs 2020-07-27 05:20:34 +01:00
Timo Mämecke
100eece7a2 docs: Fix typos and wording in Client API (#455)
While reading through the new v3 docs, I spotted a few typos and some convoluted wording. Hence I directly fixed them.
2020-07-27 05:20:34 +01:00
Ty Lange-Smith
278ecc1e48 Explicitly set expires property for session on updateSession 2020-07-27 05:20:34 +01:00
Fredrik Pettersen
a3d379554b fix(prisma): Explicitly set fields to use when updating user (#449) 2020-07-27 05:20:34 +01:00
Iain Collins
983dd98a66 Fix typo in docs 2020-07-27 05:20:34 +01:00
Iain Collins
ca3f26b8d2 Update configuration docs 2020-07-27 05:20:34 +01:00
Iain Collins
d2a2352e9a Update callback docs
Addresses issue raised in comments on #429
2020-07-27 05:20:34 +01:00
Iain Collins
3043a9525a Update documentation for client methods 2020-07-27 05:20:34 +01:00
Iain Collins
e1c6632b6f Fix typo on homepage 2020-07-27 05:20:34 +01:00
Iain Collins
56e64e322e Move help menu on mobile (again)
So many UX issue with this. Hard to wrangle it given where it is semantically.

Hopefully Docusuarus beta will improve on it in a future release.
2020-07-27 05:20:34 +01:00
Iain Collins
cbd056f225 Fix typo in tutorial 2020-07-27 05:20:34 +01:00
Iain Collins
22ab66f9d8 Cosmetic improvements to docs 2020-07-27 05:20:34 +01:00
Iain Collins
3597733dae Improve FAQ documentation 2020-07-27 05:20:34 +01:00
Iain Collins
cb9ce69ba3 Update JWT questions in FAQ 2020-07-27 05:20:34 +01:00
Iain Collins
c19a79cbca Update database docs 2020-07-27 05:20:34 +01:00
Iain Collins
e97e090b65 Improve heading formatting on docs 2020-07-27 05:20:34 +01:00
Iain Collins
eda4a6d18b Add tutorial showing how to protect pages & routes 2020-07-27 05:20:34 +01:00
Iain Collins
94f66b60d8 Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
9a85e27c0c Update README 2020-07-27 05:20:34 +01:00
Iain Collins
7fb7e3d1bc Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
90066fdbec Update homepage copy and package description 2020-07-27 05:20:34 +01:00
Iain Collins
475f0e7b51 Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
a9131724d6 Update copy on homepage 2020-07-27 05:20:34 +01:00
Iain Collins
55bfb6d9dc Update docs 2020-07-27 05:20:34 +01:00
Iain Collins
af3da3abf8 Fix linting errors 2020-07-27 05:20:34 +01:00
Iain Collins
339d9f2d03 CSS tweaks 2020-07-27 05:20:34 +01:00
Iain Collins
a24fb8b380 Update JWT documentation and FAQs 2020-07-27 05:20:34 +01:00
Iain Collins
65319e3927 Update JWT defaults
* Set encryption: false  by default
 * Use 64 bit input for generated signing key
2020-07-27 05:20:34 +01:00
Iain Collins
19917972ef Review JWT comments; enable zip encoding 2020-07-27 05:20:34 +01:00
Iain Collins
c1b412814a WIP refactor JWT based on feedback 2020-07-27 05:20:34 +01:00
Iain Collins
53ea8407ea Remove default iss check (makes it optional) 2020-07-27 05:20:34 +01:00
Iain Collins
66f46e8cc7 Use URL to ensure secret is unique per instance 2020-07-27 05:20:34 +01:00
Iain Collins
fec69a21be Refactor JWT payload to use claims
Resovles #224
2020-07-27 05:20:34 +01:00
Iain Collins
505ebb8ae1 Clean up cruft in JWT class; add comments 2020-07-27 05:20:34 +01:00
Iain Collins
fb4381d8eb Implement JWE 2020-07-27 05:20:34 +01:00
Iain Collins
4772f5b571 WIP evaluating JWE solutions 2020-07-27 05:20:34 +01:00
Iain Collins
481db425d6 WIP Add JWE
Working implementation (with limited key length and no exp check) using node-jose from Cisco.

I want to compare it panva/jose which has more features before building it out.
2020-07-27 05:20:34 +01:00
Iain Collins
b886729bb8 Update version to 3.0.0-beta.18 2020-07-27 05:20:34 +01:00
Iain Collins
3a21a9c9f1 Enforce HMAC-256 on JWT
Now that we are going to expose the option to disable encryption on tokens we need to enforce the algorithm is valid (e.g. not 'None' or 'RSA') to prevent vultrabilties being exploited by tampering with the token.

Custom encode/decode routines can be specified if someone needs to use another algorithm.
2020-07-27 05:20:34 +01:00
Iain Collins
9e4a6fec59 Update JWT and session docs 2020-07-27 05:20:34 +01:00
Iain Collins
86921022dc Refactor JWT support
* Adds option to disable encryption
* Easy to add custom helper
* Removed getJWT helper
* Added getToken helper
* Helper does not fallback to trying non-prefixed cookie on HTTPS sites
* Supports bearer tokens in HTTP header on helper #397
2020-07-27 05:20:34 +01:00
Iain Collins
f57f11e6ff Bump version to 3.0.0-beta.17 2020-07-27 05:20:34 +01:00