Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e11a7c13
Commit
e11a7c13
authored
Mar 29, 2020
by
Guy Bedford
Committed by
Joe Haddad
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsonwebtoken
parent
3b36a371
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
api-utils.ts
packages/next/next-server/server/api-utils.ts
+2
-2
package.json
packages/next/package.json
+1
-1
taskfile.js
packages/next/taskfile.js
+8
-0
misc.d.ts
packages/next/types/misc.d.ts
+4
-0
No files found.
packages/next/next-server/server/api-utils.ts
View file @
e11a7c13
...
@@ -302,7 +302,7 @@ export function tryGetPreviewData(
...
@@ -302,7 +302,7 @@ export function tryGetPreviewData(
const
tokenPreviewData
=
cookies
[
COOKIE_NAME_PRERENDER_DATA
]
const
tokenPreviewData
=
cookies
[
COOKIE_NAME_PRERENDER_DATA
]
const
jsonwebtoken
=
require
(
'jsonwebtoken'
)
as
typeof
import
(
'jsonwebtoken'
)
const
jsonwebtoken
=
require
(
'
next/dist/compiled/
jsonwebtoken'
)
as
typeof
import
(
'jsonwebtoken'
)
let
encryptedPreviewData
:
string
let
encryptedPreviewData
:
string
try
{
try
{
encryptedPreviewData
=
jsonwebtoken
.
verify
(
encryptedPreviewData
=
jsonwebtoken
.
verify
(
...
@@ -360,7 +360,7 @@ function setPreviewData<T>(
...
@@ -360,7 +360,7 @@ function setPreviewData<T>(
throw
new
Error
(
'invariant: invalid previewModeSigningKey'
)
throw
new
Error
(
'invariant: invalid previewModeSigningKey'
)
}
}
const
jsonwebtoken
=
require
(
'jsonwebtoken'
)
as
typeof
import
(
'jsonwebtoken'
)
const
jsonwebtoken
=
require
(
'
next/dist/compiled/
jsonwebtoken'
)
as
typeof
import
(
'jsonwebtoken'
)
const
payload
=
jsonwebtoken
.
sign
(
const
payload
=
jsonwebtoken
.
sign
(
encryptWithSecret
(
encryptWithSecret
(
...
...
packages/next/package.json
View file @
e11a7c13
...
@@ -71,7 +71,6 @@
...
@@ -71,7 +71,6 @@
"fork-ts-checker-webpack-plugin"
:
"3.1.1"
,
"fork-ts-checker-webpack-plugin"
:
"3.1.1"
,
"ignore-loader"
:
"0.1.2"
,
"ignore-loader"
:
"0.1.2"
,
"jest-worker"
:
"24.9.0"
,
"jest-worker"
:
"24.9.0"
,
"jsonwebtoken"
:
"8.5.1"
,
"launch-editor"
:
"2.2.1"
,
"launch-editor"
:
"2.2.1"
,
"loader-utils"
:
"2.0.0"
,
"loader-utils"
:
"2.0.0"
,
"lodash.curry"
:
"4.1.1"
,
"lodash.curry"
:
"4.1.1"
,
...
@@ -193,6 +192,7 @@
...
@@ -193,6 +192,7 @@
"is-docker"
:
"2.0.0"
,
"is-docker"
:
"2.0.0"
,
"is-wsl"
:
"2.1.1"
,
"is-wsl"
:
"2.1.1"
,
"json5"
:
"2.1.2"
,
"json5"
:
"2.1.2"
,
"jsonwebtoken"
:
"8.5.1"
,
"nanoid"
:
"2.0.3"
,
"nanoid"
:
"2.0.3"
,
"resolve"
:
"1.11.0"
,
"resolve"
:
"1.11.0"
,
"taskr"
:
"1.1.0"
,
"taskr"
:
"1.1.0"
,
...
...
packages/next/taskfile.js
View file @
e11a7c13
...
@@ -370,6 +370,13 @@ export async function ncc_json5(task, opts) {
...
@@ -370,6 +370,13 @@ export async function ncc_json5(task, opts) {
.
target
(
'dist/compiled/json5'
)
.
target
(
'dist/compiled/json5'
)
}
}
// eslint-disable-next-line camelcase
// eslint-disable-next-line camelcase
export
async
function
ncc_jsonwebtoken
(
task
,
opts
)
{
await
task
.
source
(
opts
.
src
||
relative
(
__dirname
,
require
.
resolve
(
'jsonwebtoken'
)))
.
ncc
({
packageName
:
'jsonwebtoken'
})
.
target
(
'dist/compiled/jsonwebtoken'
)
}
// eslint-disable-next-line camelcase
export
async
function
ncc_nanoid
(
task
,
opts
)
{
export
async
function
ncc_nanoid
(
task
,
opts
)
{
await
task
await
task
.
source
(
opts
.
src
||
relative
(
__dirname
,
require
.
resolve
(
'nanoid'
)))
.
source
(
opts
.
src
||
relative
(
__dirname
,
require
.
resolve
(
'nanoid'
)))
...
@@ -441,6 +448,7 @@ export async function precompile(task) {
...
@@ -441,6 +448,7 @@ export async function precompile(task) {
'ncc_is_docker'
,
'ncc_is_docker'
,
'ncc_is_wsl'
,
'ncc_is_wsl'
,
'ncc_json5'
,
'ncc_json5'
,
'ncc_jsonwebtoken'
,
'ncc_nanoid'
,
'ncc_nanoid'
,
'ncc_resolve'
,
'ncc_resolve'
,
'ncc_text_table'
,
'ncc_text_table'
,
...
...
packages/next/types/misc.d.ts
View file @
e11a7c13
...
@@ -120,6 +120,10 @@ declare module 'next/dist/compiled/json5' {
...
@@ -120,6 +120,10 @@ declare module 'next/dist/compiled/json5' {
import
m
from
'json5'
import
m
from
'json5'
export
=
m
export
=
m
}
}
declare
module
'next/dist/compiled/jsonwebtoken'
{
import
m
from
'jsonwebtoken'
export
=
m
}
declare
module
'next/dist/compiled/nanoid/index.js'
{
declare
module
'next/dist/compiled/nanoid/index.js'
{
function
nanoid
(
size
?:
number
):
string
function
nanoid
(
size
?:
number
):
string
export
=
nanoid
export
=
nanoid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment