Compare commits

...

6 Commits

Author SHA1 Message Date
Balázs Orbán
e8ddbc5c11 fix(build): export aliases from client (#1909) 2021-05-02 12:11:11 +02:00
Ernie Miranda
dfe4620056 docs(www): fix minor typo. (#1902)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-01 11:09:01 +02:00
leeoocca
848224e2c5 fix(ts): optional variables for custom provider options (#1876)
Contains the following squashed commits:

* fix optional variables for custom provider options
* revert some types for custom provider
* docs: client secret required in provider options
* Revert "docs: client secret required in provider options"
2021-05-01 10:46:04 +02:00
dependabot[bot]
aee376cc57 chore(deps): bump ssri from 6.0.1 to 6.0.2 in /www (#1901)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 21:17:23 +02:00
Amir Ali
0d2a81cd39 docs(www): syntax error on JWT_SESSION_ERROR code example (#1899) 2021-04-30 16:51:02 +02:00
Balázs Orbán
61e99c9489 fix(ts): wrap adapter option in ReturnType (#1887)
* fix(ts): wrap adapter option in ReturnType

* test(ts): fix adapter tests
2021-04-29 19:43:34 +02:00
8 changed files with 26 additions and 10 deletions

View File

@@ -355,6 +355,22 @@ function BroadcastChannel (name = 'nextauth.message') {
}
}
// Some methods are exported with more than one name. This provides some
// flexibility over how they can be invoked and backwards compatibility
// with earlier releases. These should be removed in a newer release, as it only
// creates problems for bundlers and adds confusion to users. TypeScript declarations
// will provide sufficient help when importing
export {
setOptions as options,
getSession as session,
getProviders as providers,
getCsrfToken as csrfToken,
signIn as signin,
signOut as signout
}
export default {
getSession,
getCsrfToken,

2
types/adapters.d.ts vendored
View File

@@ -124,7 +124,7 @@ export type Adapter<
P = Profile,
S = Session
> = (
config: C,
config?: C,
options?: O
) => {
getAdapter(appOptions: AppOptions): Promise<AdapterInstance<U, P, S>>

2
types/index.d.ts vendored
View File

@@ -127,7 +127,7 @@ export interface NextAuthOptions {
* [Default adapter](https://next-auth.js.org/schemas/adapters#typeorm-adapter) |
* [Community adapters](https://github.com/nextauthjs/adapters)
*/
adapter?: Adapter
adapter?: ReturnType<Adapter>
/**
* Set debug to true to enable debug messages for authentication and database operations.
* * **Default value**: `false`

View File

@@ -29,7 +29,7 @@ export interface OAuthConfig<P extends Record<string, unknown> = Profile>
scope: string
params: { grant_type: string }
accessTokenUrl: string
requestTokenUrl: string
requestTokenUrl?: string
authorizationUrl: string
profileUrl: string
profile(profile: P, tokens: TokenSet): Awaitable<User & { id: string }>

View File

@@ -65,7 +65,7 @@ const exampleVerificationRequest = {
expires: new Date(),
}
const adapter: Adapter = () => {
const MyAdapter: Adapter = () => {
return {
async getAdapter(appOptions: AppOptions) {
return {
@@ -190,7 +190,7 @@ const allConfig: NextAuthTypes.NextAuthOptions = {
return undefined
},
},
adapter,
adapter: MyAdapter(),
useSecureCookies: true,
cookies: {
sessionToken: {

View File

@@ -68,7 +68,7 @@ See the [providers documentation](/configuration/providers) for a list of suppor
A random string used to hash tokens, sign cookies and generate crytographic keys.
If not specified is uses a hash of all configuration options, including Client ID / Secrets for entropy.
If not specified, it uses a hash for all configuration options, including Client ID / Secrets for entropy.
The default behaviour is volatile, and it is strongly recommended you explicitly specify a value to avoid invalidating end user sessions when configuration changes are deployed.

View File

@@ -95,7 +95,7 @@ If you are unable to use an HS512 key (for example to interoperate with other se
````
jwt: {
signingKey: {"kty":"oct","kid":"--","alg":"HS256","k":"--"}
signingKey: {"kty":"oct","kid":"--","alg":"HS256","k":"--"},
verificationOptions: {
algorithms: ["HS256"]
}

6
www/package-lock.json generated
View File

@@ -17485,9 +17485,9 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
},
"ssri": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
"integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
"requires": {
"figgy-pudding": "^3.5.1"
}