mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: fix dashboard error (#5010)
* Fixes a TypeScript error in the dashboard functions.
This commit is contained in:
committed by
Andrew Seguin
parent
a5b014f771
commit
22e14490d2
@@ -9,7 +9,9 @@ const repoSlug = config().repoSlug;
|
||||
|
||||
export function verifyToken(token: string): boolean {
|
||||
try {
|
||||
const tokenPayload = verify(token, jwtSecret, {issuer: 'Travis CI, GmbH'});
|
||||
// The returned value of the verify method can be either a string or a object. Reading
|
||||
// properties without explicitly treating the result as `any` will lead to a TypeScript error.
|
||||
const tokenPayload = verify(token, jwtSecret, {issuer: 'Travis CI, GmbH'}) as any;
|
||||
|
||||
if (tokenPayload.slug !== repoSlug) {
|
||||
console.log(`JWT slugs are not matching. Expected ${repoSlug}`);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
"version": "0.0.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@types/jsonwebtoken": "^7.2.0",
|
||||
"@types/jsonwebtoken": "^7.2.1",
|
||||
"firebase-admin": "~4.2.1",
|
||||
"firebase-functions": "^0.5.7",
|
||||
"jsonwebtoken": "^7.4.1",
|
||||
"request": "^2.81.0",
|
||||
"ts-node": "^3.0.4",
|
||||
"typescript": "^2.3.3"
|
||||
"ts-node": "^3.0.6",
|
||||
"typescript": "^2.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
"sourceMap": true,
|
||||
"target": "es5",
|
||||
"baseUrl": "",
|
||||
"outDir": "../../../dist/dashboard-functions/"
|
||||
"outDir": "../../../dist/dashboard-functions/",
|
||||
"types": ["jsonwebtoken"]
|
||||
},
|
||||
"files": [
|
||||
"./functions.ts"
|
||||
|
||||
Reference in New Issue
Block a user