very-express 0.10.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of very-express might be problematic. Click here for more details.
- package/.tmp/_body.txt +1 -0
- package/.tmp/_idx.txt +1 -0
- package/.tmp/_token.txt +1 -0
- package/.tmp/check-a/app/.vex/meta.json +216 -0
- package/.tmp/check-a/app/Dockerfile +20 -0
- package/.tmp/check-a/app/README.md +39 -0
- package/.tmp/check-a/app/public/css/style.css +8 -0
- package/.tmp/check-a/app/public/js/deleteaccount.js +80 -0
- package/.tmp/check-a/app/public/js/login.js +59 -0
- package/.tmp/check-a/app/public/js/logincallback.js +19 -0
- package/.tmp/check-a/app/public/js/mytokens.js +11 -0
- package/.tmp/check-a/app/public/js/refreshtokens.js +23 -0
- package/.tmp/check-a/app/scripts/build.js +39 -0
- package/.tmp/check-a/app/scripts/oacg-fix.js +83 -0
- package/.tmp/check-a/app/tsconfig.json +30 -0
- package/.tmp/check-a/schemas/Project.json +41 -0
- package/.tmp/check-a/schemas/Session.json +49 -0
- package/.tmp/check-a/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/check-a/vex.config.json +26 -0
- package/.tmp/check-b/app/.env +41 -0
- package/.tmp/check-b/app/.vex/meta.json +219 -0
- package/.tmp/check-b/app/Dockerfile +20 -0
- package/.tmp/check-b/app/README.md +39 -0
- package/.tmp/check-b/app/package.json +51 -0
- package/.tmp/check-b/app/public/css/style.css +8 -0
- package/.tmp/check-b/app/public/js/deleteaccount.js +80 -0
- package/.tmp/check-b/app/public/js/login.js +59 -0
- package/.tmp/check-b/app/public/js/logincallback.js +19 -0
- package/.tmp/check-b/app/public/js/mytokens.js +11 -0
- package/.tmp/check-b/app/public/js/refreshtokens.js +23 -0
- package/.tmp/check-b/app/scripts/build.js +39 -0
- package/.tmp/check-b/app/scripts/oacg-fix.js +83 -0
- package/.tmp/check-b/app/tsconfig.json +30 -0
- package/.tmp/check-b/app/tsoa.json +32 -0
- package/.tmp/check-b/schemas/Project.json +41 -0
- package/.tmp/check-b/vex.config.json +30 -0
- package/.tmp/check-c/app/.env +41 -0
- package/.tmp/check-c/app/.vex/meta.json +231 -0
- package/.tmp/check-c/app/Dockerfile +20 -0
- package/.tmp/check-c/app/README.md +39 -0
- package/.tmp/check-c/app/package.json +51 -0
- package/.tmp/check-c/app/public/css/style.css +8 -0
- package/.tmp/check-c/app/public/js/deleteaccount.js +80 -0
- package/.tmp/check-c/app/public/js/login.js +59 -0
- package/.tmp/check-c/app/public/js/logincallback.js +19 -0
- package/.tmp/check-c/app/public/js/mytokens.js +11 -0
- package/.tmp/check-c/app/public/js/refreshtokens.js +23 -0
- package/.tmp/check-c/app/scripts/build.js +39 -0
- package/.tmp/check-c/app/scripts/oacg-fix.js +83 -0
- package/.tmp/check-c/app/tsconfig.json +30 -0
- package/.tmp/check-c/app/tsoa.json +32 -0
- package/.tmp/check-c/schemas/Project.json +41 -0
- package/.tmp/check-c/schemas/User.json +81 -0
- package/.tmp/check-c/vex.config.json +30 -0
- package/.tmp/demo-project/vex.config.json +43 -0
- package/.tmp/demo-project2/vex.config.json +43 -0
- package/.tmp/demo-schemas/Client.json +65 -0
- package/.tmp/demo-schemas/FnbOrder.json +33 -0
- package/.tmp/demo-schemas/Job.json +86 -0
- package/.tmp/demo-schemas/KernelEvent.json +29 -0
- package/.tmp/demo-schemas/Package.json +77 -0
- package/.tmp/demo-schemas/Session.json +49 -0
- package/.tmp/demo-schemas/Tenant.json +22 -0
- package/.tmp/demo-schemas/User.json +81 -0
- package/.tmp/demo-schemas/UserAuthProfiles.json +54 -0
- package/.tmp/demo-schemas/UserContact.json +76 -0
- package/.tmp/demo-schemas/UserRole.json +40 -0
- package/.tmp/demo-schemas/UserTenant.json +39 -0
- package/.tmp/demo-schemas2/Client.json +65 -0
- package/.tmp/demo-schemas2/FnbOrder.json +33 -0
- package/.tmp/demo-schemas2/Job.json +86 -0
- package/.tmp/demo-schemas2/KernelEvent.json +29 -0
- package/.tmp/demo-schemas2/Package.json +77 -0
- package/.tmp/demo-schemas2/Session.json +49 -0
- package/.tmp/demo-schemas2/Tenant.json +22 -0
- package/.tmp/demo-schemas2/User.json +81 -0
- package/.tmp/demo-schemas2/UserAuthProfiles.json +54 -0
- package/.tmp/demo-schemas2/UserContact.json +76 -0
- package/.tmp/demo-schemas2/UserRole.json +40 -0
- package/.tmp/demo-schemas2/UserTenant.json +39 -0
- package/.tmp/e2e-db.url +1 -0
- package/.tmp/nouser/out/.env +41 -0
- package/.tmp/nouser/out/.vex/meta.json +323 -0
- package/.tmp/nouser/out/Dockerfile +20 -0
- package/.tmp/nouser/out/README.md +39 -0
- package/.tmp/nouser/out/package.json +51 -0
- package/.tmp/nouser/out/public/css/style.css +8 -0
- package/.tmp/nouser/out/public/js/deleteaccount.js +80 -0
- package/.tmp/nouser/out/public/js/login.js +59 -0
- package/.tmp/nouser/out/public/js/logincallback.js +19 -0
- package/.tmp/nouser/out/public/js/mytokens.js +11 -0
- package/.tmp/nouser/out/public/js/refreshtokens.js +23 -0
- package/.tmp/nouser/out/scripts/build.js +39 -0
- package/.tmp/nouser/out/scripts/oacg-fix.js +83 -0
- package/.tmp/nouser/out/tsconfig.json +30 -0
- package/.tmp/nouser/out/tsoa.json +32 -0
- package/.tmp/nouser/schemas/Project.json +41 -0
- package/.tmp/nouser/schemas/Session.json +49 -0
- package/.tmp/nouser/schemas/User.json +81 -0
- package/.tmp/nouser/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/nouser/schemas/UserTenant.json +39 -0
- package/.tmp/nouser/vex.config.json +34 -0
- package/.tmp/npm-test-after-fix.log +217 -0
- package/.tmp/npm-test-final.log +165 -0
- package/.tmp/npm-test-final2.log +163 -0
- package/.tmp/npm-test-recheck.log +192 -0
- package/.tmp/npm-test-update.log +164 -0
- package/.tmp/npm-test.log +166 -0
- package/.tmp/output-build-after-fix.log +8 -0
- package/.tmp/output-build-baseline.log +8 -0
- package/.tmp/output-build-canonical.log +8 -0
- package/.tmp/output-build-final2.log +8 -0
- package/.tmp/output-build-reapply.log +8 -0
- package/.tmp/output-build.log +8 -0
- package/.tmp/output.env.bak +34 -0
- package/.tmp/probe_body.txt +1 -0
- package/.tmp/provision-e2e-db.js +41 -0
- package/.tmp/retry-nodestroy.log +18 -0
- package/.tmp/retry-recovery-final2.log +8 -0
- package/.tmp/retry-recovery-reapply.log +8 -0
- package/.tmp/retry-recovery.js +38 -0
- package/.tmp/run-e2e-single.js +21 -0
- package/.tmp/run-e2e.js +18 -0
- package/.tmp/verify-noauth/app/.env +41 -0
- package/.tmp/verify-noauth/app/.vex/meta.json +333 -0
- package/.tmp/verify-noauth/app/Dockerfile +20 -0
- package/.tmp/verify-noauth/app/README.md +39 -0
- package/.tmp/verify-noauth/app/package.json +51 -0
- package/.tmp/verify-noauth/app/public/css/style.css +8 -0
- package/.tmp/verify-noauth/app/public/js/deleteaccount.js +80 -0
- package/.tmp/verify-noauth/app/public/js/login.js +59 -0
- package/.tmp/verify-noauth/app/public/js/logincallback.js +19 -0
- package/.tmp/verify-noauth/app/public/js/mytokens.js +11 -0
- package/.tmp/verify-noauth/app/public/js/refreshtokens.js +23 -0
- package/.tmp/verify-noauth/app/scripts/build.js +39 -0
- package/.tmp/verify-noauth/app/scripts/oacg-fix.js +83 -0
- package/.tmp/verify-noauth/app/tsconfig.json +30 -0
- package/.tmp/verify-noauth/app/tsoa.json +32 -0
- package/.tmp/verify-noauth/schemas/Project.json +41 -0
- package/.tmp/verify-noauth/schemas/Session.json +49 -0
- package/.tmp/verify-noauth/schemas/User.json +81 -0
- package/.tmp/verify-noauth/schemas/UserAuthProfiles.json +54 -0
- package/.tmp/verify-noauth/schemas/UserTenant.json +39 -0
- package/.tmp/verify-noauth/vex.config.json +33 -0
- package/.tmp/verify-noauth-rbac/app/.env +41 -0
- package/.tmp/verify-noauth-rbac/app/.vex/meta.json +273 -0
- package/.tmp/verify-noauth-rbac/app/Dockerfile +20 -0
- package/.tmp/verify-noauth-rbac/app/README.md +39 -0
- package/.tmp/verify-noauth-rbac/app/package.json +51 -0
- package/.tmp/verify-noauth-rbac/app/public/css/style.css +8 -0
- package/.tmp/verify-noauth-rbac/app/public/js/deleteaccount.js +80 -0
- package/.tmp/verify-noauth-rbac/app/public/js/login.js +59 -0
- package/.tmp/verify-noauth-rbac/app/public/js/logincallback.js +19 -0
- package/.tmp/verify-noauth-rbac/app/public/js/mytokens.js +11 -0
- package/.tmp/verify-noauth-rbac/app/public/js/refreshtokens.js +23 -0
- package/.tmp/verify-noauth-rbac/app/scripts/build.js +39 -0
- package/.tmp/verify-noauth-rbac/app/scripts/oacg-fix.js +83 -0
- package/.tmp/verify-noauth-rbac/app/tsconfig.json +30 -0
- package/.tmp/verify-noauth-rbac/app/tsoa.json +32 -0
- package/.tmp/verify-noauth-rbac/schemas/Project.json +41 -0
- package/.tmp/verify-noauth-rbac/schemas/User.json +81 -0
- package/.tmp/verify-noauth-rbac/schemas/UserRole.json +38 -0
- package/.tmp/verify-noauth-rbac/vex.config.json +36 -0
- package/.tmp/verify.sh +103 -0
- package/.tmp/verify2.sh +103 -0
- package/.tmp/vex-gen-after-fix.log +221 -0
- package/.tmp/vex-gen-baseline.log +221 -0
- package/.tmp/vex-gen-canonical.log +221 -0
- package/.tmp/vex-gen-final.log +220 -0
- package/.tmp/vex-gen-final2.log +221 -0
- package/.tmp/vex-gen-reapply.log +221 -0
- package/.tmp/vex-gen.log +220 -0
- package/.tmp/vex-run-after-fix.log +3 -0
- package/.tmp/vex-run-baseline.log +11 -0
- package/.tmp/vex-run-before-fix.log +11 -0
- package/.tmp/vex-run-canonical.log +3 -0
- package/.tmp/vex-run-final2.log +3 -0
- package/.tmp/vex-run.log +3 -0
- package/.tmp/vo/app/.env +41 -0
- package/.tmp/vo/app/.vex/meta.json +231 -0
- package/.tmp/vo/app/Dockerfile +20 -0
- package/.tmp/vo/app/README.md +39 -0
- package/.tmp/vo/app/package.json +51 -0
- package/.tmp/vo/app/public/css/style.css +8 -0
- package/.tmp/vo/app/public/js/deleteaccount.js +80 -0
- package/.tmp/vo/app/public/js/login.js +59 -0
- package/.tmp/vo/app/public/js/logincallback.js +19 -0
- package/.tmp/vo/app/public/js/mytokens.js +11 -0
- package/.tmp/vo/app/public/js/refreshtokens.js +23 -0
- package/.tmp/vo/app/scripts/build.js +39 -0
- package/.tmp/vo/app/scripts/oacg-fix.js +83 -0
- package/.tmp/vo/app/tsconfig.json +30 -0
- package/.tmp/vo/app/tsoa.json +32 -0
- package/.tmp/vo/schemas/Project.json +41 -0
- package/.tmp/vo/vex.config.json +33 -0
- package/.tmp/vo-bad1/app/.env +41 -0
- package/.tmp/vo-bad1/app/.vex/meta.json +237 -0
- package/.tmp/vo-bad1/app/Dockerfile +20 -0
- package/.tmp/vo-bad1/app/README.md +39 -0
- package/.tmp/vo-bad1/app/package.json +51 -0
- package/.tmp/vo-bad1/app/public/css/style.css +8 -0
- package/.tmp/vo-bad1/app/public/js/deleteaccount.js +80 -0
- package/.tmp/vo-bad1/app/public/js/login.js +59 -0
- package/.tmp/vo-bad1/app/public/js/logincallback.js +19 -0
- package/.tmp/vo-bad1/app/public/js/mytokens.js +11 -0
- package/.tmp/vo-bad1/app/public/js/refreshtokens.js +23 -0
- package/.tmp/vo-bad1/app/scripts/build.js +39 -0
- package/.tmp/vo-bad1/app/scripts/oacg-fix.js +83 -0
- package/.tmp/vo-bad1/app/tsconfig.json +30 -0
- package/.tmp/vo-bad1/app/tsoa.json +32 -0
- package/.tmp/vo-bad1/schemas/Project.json +41 -0
- package/.tmp/vo-bad1/vex.config.json +33 -0
- package/.tmp/vo-bad2/app/.env +41 -0
- package/.tmp/vo-bad2/app/.vex/meta.json +237 -0
- package/.tmp/vo-bad2/app/Dockerfile +20 -0
- package/.tmp/vo-bad2/app/README.md +39 -0
- package/.tmp/vo-bad2/app/package.json +51 -0
- package/.tmp/vo-bad2/app/public/css/style.css +8 -0
- package/.tmp/vo-bad2/app/public/js/deleteaccount.js +80 -0
- package/.tmp/vo-bad2/app/public/js/login.js +59 -0
- package/.tmp/vo-bad2/app/public/js/logincallback.js +19 -0
- package/.tmp/vo-bad2/app/public/js/mytokens.js +11 -0
- package/.tmp/vo-bad2/app/public/js/refreshtokens.js +23 -0
- package/.tmp/vo-bad2/app/scripts/build.js +39 -0
- package/.tmp/vo-bad2/app/scripts/oacg-fix.js +83 -0
- package/.tmp/vo-bad2/app/tsconfig.json +30 -0
- package/.tmp/vo-bad2/app/tsoa.json +32 -0
- package/.tmp/vo-bad2/schemas/Project.json +41 -0
- package/.tmp/vo-bad2/vex.config.json +39 -0
- package/.tmp/vo-bad3/app/.env +41 -0
- package/.tmp/vo-bad3/app/.vex/meta.json +237 -0
- package/.tmp/vo-bad3/app/Dockerfile +20 -0
- package/.tmp/vo-bad3/app/README.md +39 -0
- package/.tmp/vo-bad3/app/package.json +51 -0
- package/.tmp/vo-bad3/app/public/css/style.css +8 -0
- package/.tmp/vo-bad3/app/public/js/deleteaccount.js +80 -0
- package/.tmp/vo-bad3/app/public/js/login.js +59 -0
- package/.tmp/vo-bad3/app/public/js/logincallback.js +19 -0
- package/.tmp/vo-bad3/app/public/js/mytokens.js +11 -0
- package/.tmp/vo-bad3/app/public/js/refreshtokens.js +23 -0
- package/.tmp/vo-bad3/app/scripts/build.js +39 -0
- package/.tmp/vo-bad3/app/scripts/oacg-fix.js +83 -0
- package/.tmp/vo-bad3/app/tsconfig.json +30 -0
- package/.tmp/vo-bad3/app/tsoa.json +32 -0
- package/.tmp/vo-bad3/schemas/Project.json +41 -0
- package/.tmp/vo-bad3/vex.config.json +33 -0
- package/dist/index.js +1156 -698
- package/dist/templates/_middlewares/UserContext.ts +1 -1
- package/dist/templates/_routes/FirebaseAuthUI.gen.ts +2 -2
- package/dist/templates/_routes/{LoginUI.ts → StarterUI.ts} +122 -8
- package/dist/templates/_utils/hash.ts +9 -4
- package/dist/templates/tenantJsonSchema/Tenant.json +22 -0
- package/docs/appGenerated/auth.md +50 -0
- package/docs/architecture/databaseTargets.md +23 -2
- package/docs/architecture/templates.md +7 -0
- package/docs/features/accountDeletion.md +5 -4
- package/docs/features/auditFields.md +2 -2
- package/docs/features/tenantIsolation.md +108 -15
- package/docs/releaseNote/v0-10-4.md +102 -0
- package/docs/releaseNote/v0-11-0.md +82 -0
- package/docs/vexJsonSchema.md +33 -0
- package/package.json +1 -1
- package/vex.config.json +6 -1
- package/dist/templates/_services/VexDbConnector.ts +0 -188
- package/dist/templates/_tenant/TenantScopeContext.ts +0 -56
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"x-documentConfig": {
|
|
4
|
+
"documentName": "UserRole",
|
|
5
|
+
"restApi": {
|
|
6
|
+
"methods": [],
|
|
7
|
+
"joinWhitelist": []
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"properties": {
|
|
11
|
+
"_id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"x-format": "Primary"
|
|
14
|
+
},
|
|
15
|
+
"userId": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"index": true,
|
|
18
|
+
"x-foreignKey": {
|
|
19
|
+
"schemaName": "User",
|
|
20
|
+
"fieldName": "_id",
|
|
21
|
+
"relationType": "many-to-one"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"role": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"x-vexData": "role",
|
|
27
|
+
"index": true,
|
|
28
|
+
"enum": [
|
|
29
|
+
"visitor",
|
|
30
|
+
"member",
|
|
31
|
+
"admin"
|
|
32
|
+
],
|
|
33
|
+
"x-format": "enum"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"userId",
|
|
38
|
+
"role"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"x-documentConfig": {
|
|
4
|
+
"documentName": "UserTenant",
|
|
5
|
+
"restApi": {
|
|
6
|
+
"methods": [],
|
|
7
|
+
"joinWhitelist": []
|
|
8
|
+
},
|
|
9
|
+
"uniqueIndex": [
|
|
10
|
+
[
|
|
11
|
+
"userId",
|
|
12
|
+
"tenantId"
|
|
13
|
+
]
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"userId",
|
|
18
|
+
"tenantId"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"_id": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"x-format": "PrimaryUUID",
|
|
24
|
+
"index": true
|
|
25
|
+
},
|
|
26
|
+
"userId": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"x-format": "UUID",
|
|
29
|
+
"index": true,
|
|
30
|
+
"description": "Identity document id. Managed by TenantService."
|
|
31
|
+
},
|
|
32
|
+
"tenantId": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"x-format": "UUID",
|
|
35
|
+
"index": true,
|
|
36
|
+
"description": "Tenant id (UUID). Managed by TenantService."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
package/.tmp/e2e-db.url
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
postgresql://veryexpress:7PP8BWWFMGeRsyWn@43.128.111.169:5432/vex_e2e
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
APP_HOST=http://localhost
|
|
2
|
+
APP_PORT=3000
|
|
3
|
+
MONGODB_URI=mongodb://localhost:27017/veryExpressDB
|
|
4
|
+
SQL_URI=postgresql://username:password@localhost:5432/mydatabase
|
|
5
|
+
SQL_CA=""
|
|
6
|
+
SQL_INSECURE_TLS=true
|
|
7
|
+
SQL_SYNCHRONIZE=true
|
|
8
|
+
|
|
9
|
+
LOGIN_SUCCESS_REDIRECT_PATH=/logincallback
|
|
10
|
+
LOGIN_FAILED_REDIRECT_PATH=/logincallback
|
|
11
|
+
|
|
12
|
+
# OAUTH
|
|
13
|
+
OAUTH_GOOGLE_CLIENTID=
|
|
14
|
+
OAUTH_GOOGLE_CLIENTSECRET=
|
|
15
|
+
OAUTH_GITHUB_CLIENTID=
|
|
16
|
+
OAUTH_GITHUB_CLIENTSECRET=
|
|
17
|
+
# OAUTH_MICROSOFT_CLIENTID=
|
|
18
|
+
# OAUTH_MICROSOFT_CLIENTSECRET=
|
|
19
|
+
# OAUTH_APPLE_CLIENTID=
|
|
20
|
+
# OAUTH_APPLE_CLIENTSECRET=
|
|
21
|
+
|
|
22
|
+
# FIREBASE (auth.firebase in vex.config.json) — see docs/appGenerated/auth.md
|
|
23
|
+
# Server credential: firebase-admin verifies ID tokens, so the project's service account is required.
|
|
24
|
+
# The JSON itself, as one value — generate it in the Firebase console:
|
|
25
|
+
# Project settings > Service accounts > Generate new private key.
|
|
26
|
+
FIREBASE_SERVICE_ACCOUNT_JSON=
|
|
27
|
+
# Browser config: Firebase's *public* web app values, served to the login page by design. There is no
|
|
28
|
+
# secret among them, and no appId — Firebase Auth does not read one.
|
|
29
|
+
FIREBASE_WEB_API_KEY=
|
|
30
|
+
FIREBASE_WEB_AUTH_DOMAIN=
|
|
31
|
+
FIREBASE_WEB_PROJECT_ID=
|
|
32
|
+
# Optional: which sign-in methods the login page renders a button for, comma separated. Defaults to
|
|
33
|
+
# google. The server accepts any provider it knows regardless of this list.
|
|
34
|
+
# FIREBASE_PROVIDERS=google
|
|
35
|
+
|
|
36
|
+
# JWT token
|
|
37
|
+
ACCESS_TOKEN_EXPIRE_TIME='1h'
|
|
38
|
+
REFRESH_TOKEN_EXPIRE_TIME='24h'
|
|
39
|
+
SESSION_COOKIE_SECRET='my-session-cookie-secret'
|
|
40
|
+
JWT_ALGORITHM='HS256'
|
|
41
|
+
JWT_SECRET0='my-secret-key0'
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lastGeneratedVersion": "0.10.3",
|
|
3
|
+
"files": {
|
|
4
|
+
"..": {
|
|
5
|
+
"vex.config.json": {
|
|
6
|
+
"lastWriteVersion": "0.10.3",
|
|
7
|
+
"allowOverwrite": true
|
|
8
|
+
},
|
|
9
|
+
"schemas": {
|
|
10
|
+
"Session.json": {
|
|
11
|
+
"lastWriteVersion": "0.10.3",
|
|
12
|
+
"allowOverwrite": true
|
|
13
|
+
},
|
|
14
|
+
"User.json": {
|
|
15
|
+
"lastWriteVersion": "0.10.3",
|
|
16
|
+
"allowOverwrite": true
|
|
17
|
+
},
|
|
18
|
+
"UserAuthProfiles.json": {
|
|
19
|
+
"lastWriteVersion": "0.10.3",
|
|
20
|
+
"allowOverwrite": true
|
|
21
|
+
},
|
|
22
|
+
"UserTenant.json": {
|
|
23
|
+
"lastWriteVersion": "0.10.3",
|
|
24
|
+
"allowOverwrite": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"src": {
|
|
29
|
+
"system": {
|
|
30
|
+
"_controllers": {
|
|
31
|
+
"_ControllerFactory.gen.ts": {
|
|
32
|
+
"lastWriteVersion": "0.10.3",
|
|
33
|
+
"allowOverwrite": true
|
|
34
|
+
},
|
|
35
|
+
"ProjectController.gen.ts": {
|
|
36
|
+
"lastWriteVersion": "0.10.3",
|
|
37
|
+
"allowOverwrite": true
|
|
38
|
+
},
|
|
39
|
+
"UserController.gen.ts": {
|
|
40
|
+
"lastWriteVersion": "0.10.3",
|
|
41
|
+
"allowOverwrite": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"_middlewares": {
|
|
45
|
+
"Authentication.gen.ts": {
|
|
46
|
+
"lastWriteVersion": "0.10.3",
|
|
47
|
+
"allowOverwrite": true
|
|
48
|
+
},
|
|
49
|
+
"JoinWhitelistMiddleware.gen.ts": {
|
|
50
|
+
"lastWriteVersion": "0.10.3",
|
|
51
|
+
"allowOverwrite": true
|
|
52
|
+
},
|
|
53
|
+
"UserContext.gen.ts": {
|
|
54
|
+
"lastWriteVersion": "0.10.3",
|
|
55
|
+
"allowOverwrite": true
|
|
56
|
+
},
|
|
57
|
+
"tsoaAuthentication.gen.ts": {
|
|
58
|
+
"lastWriteVersion": "0.10.3",
|
|
59
|
+
"allowOverwrite": true
|
|
60
|
+
},
|
|
61
|
+
"JoinWhitelistRegistry.gen.ts": {
|
|
62
|
+
"lastWriteVersion": "0.10.3",
|
|
63
|
+
"allowOverwrite": true
|
|
64
|
+
},
|
|
65
|
+
"DataIsolationRegistry.gen.ts": {
|
|
66
|
+
"lastWriteVersion": "0.10.3",
|
|
67
|
+
"allowOverwrite": true
|
|
68
|
+
},
|
|
69
|
+
"VexFieldRegistry.gen.ts": {
|
|
70
|
+
"lastWriteVersion": "0.10.3",
|
|
71
|
+
"allowOverwrite": true
|
|
72
|
+
},
|
|
73
|
+
"TenantScopeContext.gen.ts": {
|
|
74
|
+
"lastWriteVersion": "0.10.3",
|
|
75
|
+
"allowOverwrite": true
|
|
76
|
+
},
|
|
77
|
+
"TenantScope.gen.ts": {
|
|
78
|
+
"lastWriteVersion": "0.10.3",
|
|
79
|
+
"allowOverwrite": true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"_routes": {
|
|
83
|
+
"FirebaseAuthUI.gen.ts": {
|
|
84
|
+
"lastWriteVersion": "0.10.3",
|
|
85
|
+
"allowOverwrite": true
|
|
86
|
+
},
|
|
87
|
+
"LoginUI.gen.ts": {
|
|
88
|
+
"lastWriteVersion": "0.10.3",
|
|
89
|
+
"allowOverwrite": true
|
|
90
|
+
},
|
|
91
|
+
"oauth": {
|
|
92
|
+
"OAuthRouteFactory.gen.ts": {
|
|
93
|
+
"lastWriteVersion": "0.10.3",
|
|
94
|
+
"allowOverwrite": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"SwaggerRouter.gen.ts": {
|
|
98
|
+
"lastWriteVersion": "0.10.3",
|
|
99
|
+
"allowOverwrite": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"_services": {
|
|
103
|
+
"MongooseRepositoryAdapter.gen.ts": {
|
|
104
|
+
"lastWriteVersion": "0.10.3",
|
|
105
|
+
"allowOverwrite": true
|
|
106
|
+
},
|
|
107
|
+
"TypeOrmRepositoryAdapter.gen.ts": {
|
|
108
|
+
"lastWriteVersion": "0.10.3",
|
|
109
|
+
"allowOverwrite": true
|
|
110
|
+
},
|
|
111
|
+
"VexDb.gen.ts": {
|
|
112
|
+
"lastWriteVersion": "0.10.3",
|
|
113
|
+
"allowOverwrite": true
|
|
114
|
+
},
|
|
115
|
+
"VexDbConnector.gen.ts": {
|
|
116
|
+
"lastWriteVersion": "0.10.3",
|
|
117
|
+
"allowOverwrite": true
|
|
118
|
+
},
|
|
119
|
+
"VexSystem.gen.ts": {
|
|
120
|
+
"lastWriteVersion": "0.10.3",
|
|
121
|
+
"allowOverwrite": true
|
|
122
|
+
},
|
|
123
|
+
"auth": {
|
|
124
|
+
"JWTKeyStore.gen.ts": {
|
|
125
|
+
"lastWriteVersion": "0.10.3",
|
|
126
|
+
"allowOverwrite": true
|
|
127
|
+
},
|
|
128
|
+
"JWTService.gen.ts": {
|
|
129
|
+
"lastWriteVersion": "0.10.3",
|
|
130
|
+
"allowOverwrite": true
|
|
131
|
+
},
|
|
132
|
+
"AccountStateGuard.gen.ts": {
|
|
133
|
+
"lastWriteVersion": "0.10.3",
|
|
134
|
+
"allowOverwrite": true
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"oauth": {
|
|
138
|
+
"OAuthProfileMap.gen.ts": {
|
|
139
|
+
"lastWriteVersion": "0.10.3",
|
|
140
|
+
"allowOverwrite": true
|
|
141
|
+
},
|
|
142
|
+
"OAuthStrategyService.gen.ts": {
|
|
143
|
+
"lastWriteVersion": "0.10.3",
|
|
144
|
+
"allowOverwrite": true
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"TenantService.gen.ts": {
|
|
148
|
+
"lastWriteVersion": "0.10.3",
|
|
149
|
+
"allowOverwrite": true
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"_types": {
|
|
153
|
+
"auth.gen.ts": {
|
|
154
|
+
"lastWriteVersion": "0.10.3",
|
|
155
|
+
"allowOverwrite": true
|
|
156
|
+
},
|
|
157
|
+
"vex": {
|
|
158
|
+
"VexRepository.gen.ts": {
|
|
159
|
+
"lastWriteVersion": "0.10.3",
|
|
160
|
+
"allowOverwrite": true
|
|
161
|
+
},
|
|
162
|
+
"VexRequest.gen.ts": {
|
|
163
|
+
"lastWriteVersion": "0.10.3",
|
|
164
|
+
"allowOverwrite": true
|
|
165
|
+
},
|
|
166
|
+
"VexResErr.gen.ts": {
|
|
167
|
+
"lastWriteVersion": "0.10.3",
|
|
168
|
+
"allowOverwrite": true
|
|
169
|
+
},
|
|
170
|
+
"VexResOk.gen.ts": {
|
|
171
|
+
"lastWriteVersion": "0.10.3",
|
|
172
|
+
"allowOverwrite": true
|
|
173
|
+
},
|
|
174
|
+
"VexResponse.gen.ts": {
|
|
175
|
+
"lastWriteVersion": "0.10.3",
|
|
176
|
+
"allowOverwrite": true
|
|
177
|
+
},
|
|
178
|
+
"index.ts": {
|
|
179
|
+
"lastWriteVersion": "0.10.3",
|
|
180
|
+
"allowOverwrite": true
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"Project.gen.ts": {
|
|
184
|
+
"lastWriteVersion": "0.10.3",
|
|
185
|
+
"allowOverwrite": true
|
|
186
|
+
},
|
|
187
|
+
"Session.gen.ts": {
|
|
188
|
+
"lastWriteVersion": "0.10.3",
|
|
189
|
+
"allowOverwrite": true
|
|
190
|
+
},
|
|
191
|
+
"User.gen.ts": {
|
|
192
|
+
"lastWriteVersion": "0.10.3",
|
|
193
|
+
"allowOverwrite": true
|
|
194
|
+
},
|
|
195
|
+
"UserAuthProfiles.gen.ts": {
|
|
196
|
+
"lastWriteVersion": "0.10.3",
|
|
197
|
+
"allowOverwrite": true
|
|
198
|
+
},
|
|
199
|
+
"UserTenant.gen.ts": {
|
|
200
|
+
"lastWriteVersion": "0.10.3",
|
|
201
|
+
"allowOverwrite": true
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"_utils": {
|
|
205
|
+
"hash.gen.ts": {
|
|
206
|
+
"lastWriteVersion": "0.10.3",
|
|
207
|
+
"allowOverwrite": true
|
|
208
|
+
},
|
|
209
|
+
"index.ts": {
|
|
210
|
+
"lastWriteVersion": "0.10.3",
|
|
211
|
+
"allowOverwrite": true
|
|
212
|
+
},
|
|
213
|
+
"logger.gen.ts": {
|
|
214
|
+
"lastWriteVersion": "0.10.3",
|
|
215
|
+
"allowOverwrite": true
|
|
216
|
+
},
|
|
217
|
+
"processTimer.gen.ts": {
|
|
218
|
+
"lastWriteVersion": "0.10.3",
|
|
219
|
+
"allowOverwrite": true
|
|
220
|
+
},
|
|
221
|
+
"response.gen.ts": {
|
|
222
|
+
"lastWriteVersion": "0.10.3",
|
|
223
|
+
"allowOverwrite": true
|
|
224
|
+
},
|
|
225
|
+
"validator.gen.ts": {
|
|
226
|
+
"lastWriteVersion": "0.10.3",
|
|
227
|
+
"allowOverwrite": true
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"_models": {
|
|
231
|
+
"ProjectModel.gen.ts": {
|
|
232
|
+
"lastWriteVersion": "0.10.3",
|
|
233
|
+
"allowOverwrite": true
|
|
234
|
+
},
|
|
235
|
+
"SessionModel.gen.ts": {
|
|
236
|
+
"lastWriteVersion": "0.10.3",
|
|
237
|
+
"allowOverwrite": true
|
|
238
|
+
},
|
|
239
|
+
"UserModel.gen.ts": {
|
|
240
|
+
"lastWriteVersion": "0.10.3",
|
|
241
|
+
"allowOverwrite": true
|
|
242
|
+
},
|
|
243
|
+
"UserAuthProfilesModel.gen.ts": {
|
|
244
|
+
"lastWriteVersion": "0.10.3",
|
|
245
|
+
"allowOverwrite": true
|
|
246
|
+
},
|
|
247
|
+
"UserTenantModel.gen.ts": {
|
|
248
|
+
"lastWriteVersion": "0.10.3",
|
|
249
|
+
"allowOverwrite": true
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"server.ts": {
|
|
254
|
+
"lastWriteVersion": "0.10.3",
|
|
255
|
+
"allowOverwrite": true
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"Dockerfile": {
|
|
259
|
+
"lastWriteVersion": "0.10.3",
|
|
260
|
+
"allowOverwrite": true
|
|
261
|
+
},
|
|
262
|
+
"README.md": {
|
|
263
|
+
"lastWriteVersion": "0.10.3",
|
|
264
|
+
"allowOverwrite": true
|
|
265
|
+
},
|
|
266
|
+
"public": {
|
|
267
|
+
"css": {
|
|
268
|
+
"style.css": {
|
|
269
|
+
"lastWriteVersion": "0.10.3",
|
|
270
|
+
"allowOverwrite": true
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"js": {
|
|
274
|
+
"deleteaccount.js": {
|
|
275
|
+
"lastWriteVersion": "0.10.3",
|
|
276
|
+
"allowOverwrite": true
|
|
277
|
+
},
|
|
278
|
+
"login.js": {
|
|
279
|
+
"lastWriteVersion": "0.10.3",
|
|
280
|
+
"allowOverwrite": true
|
|
281
|
+
},
|
|
282
|
+
"logincallback.js": {
|
|
283
|
+
"lastWriteVersion": "0.10.3",
|
|
284
|
+
"allowOverwrite": true
|
|
285
|
+
},
|
|
286
|
+
"mytokens.js": {
|
|
287
|
+
"lastWriteVersion": "0.10.3",
|
|
288
|
+
"allowOverwrite": true
|
|
289
|
+
},
|
|
290
|
+
"refreshtokens.js": {
|
|
291
|
+
"lastWriteVersion": "0.10.3",
|
|
292
|
+
"allowOverwrite": true
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"scripts": {
|
|
297
|
+
"build.js": {
|
|
298
|
+
"lastWriteVersion": "0.10.3",
|
|
299
|
+
"allowOverwrite": true
|
|
300
|
+
},
|
|
301
|
+
"oacg-fix.js": {
|
|
302
|
+
"lastWriteVersion": "0.10.3",
|
|
303
|
+
"allowOverwrite": true
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"tsconfig.json": {
|
|
307
|
+
"lastWriteVersion": "0.10.3",
|
|
308
|
+
"allowOverwrite": true
|
|
309
|
+
},
|
|
310
|
+
"package.json": {
|
|
311
|
+
"lastWriteVersion": "0.10.3",
|
|
312
|
+
"allowOverwrite": true
|
|
313
|
+
},
|
|
314
|
+
".env": {
|
|
315
|
+
"lastWriteVersion": "0.10.3",
|
|
316
|
+
"allowOverwrite": true
|
|
317
|
+
},
|
|
318
|
+
"tsoa.json": {
|
|
319
|
+
"lastWriteVersion": "0.10.3",
|
|
320
|
+
"allowOverwrite": true
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Use the official Node.js image as the base image
|
|
2
|
+
FROM node:14
|
|
3
|
+
|
|
4
|
+
# Set the working directory inside the container
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Copy package.json and package-lock.json to the working directory
|
|
8
|
+
COPY package*.json ./
|
|
9
|
+
|
|
10
|
+
# Install dependencies
|
|
11
|
+
RUN npm install
|
|
12
|
+
|
|
13
|
+
# Copy only the /dist directory to the working directory
|
|
14
|
+
COPY dist ./dist
|
|
15
|
+
|
|
16
|
+
# Expose the port the app runs on
|
|
17
|
+
EXPOSE 3000
|
|
18
|
+
|
|
19
|
+
# Define the command to run the application
|
|
20
|
+
CMD ["npm", "start"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This app is generated by [VeryExpress](https://github.com/Justin26l/VeryExpress)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Quick Start
|
|
5
|
+
1. install `very-express` from npm
|
|
6
|
+
`npm install -g very-express` or `npm update -g very-express`
|
|
7
|
+
|
|
8
|
+
2. check configuration file [vex.config.json](./vex.config.json) under project root directory and keep it updated (re-generate the app with very-express).
|
|
9
|
+
`vex`
|
|
10
|
+
|
|
11
|
+
3. we should have a express typescript app.
|
|
12
|
+
```
|
|
13
|
+
├── src/
|
|
14
|
+
│ └── openapi
|
|
15
|
+
│ └── roles (role based access control settings)
|
|
16
|
+
│ └── system (very express generated app)
|
|
17
|
+
├── package.json
|
|
18
|
+
├── tsconfig.json
|
|
19
|
+
├── vex.config.json
|
|
20
|
+
├── .env
|
|
21
|
+
└── ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
4. start the generated express app.
|
|
25
|
+
```
|
|
26
|
+
npm i
|
|
27
|
+
npm build
|
|
28
|
+
npm run start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
5. start the app in docker.
|
|
32
|
+
```
|
|
33
|
+
npm run docker-build
|
|
34
|
+
npm run docker-start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
# Resource
|
|
38
|
+
- [Documents](https://github.com/Justin26l/VeryExpress/blob/main/README.md)
|
|
39
|
+
- [VeryExpress Discord](https://discord.gg/PZGMzDp7)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "index.js",
|
|
3
|
+
"scripts": {
|
|
4
|
+
"build": "npm run openapi && tsc -p . && node scripts/build.js",
|
|
5
|
+
"start": "node dist/server.js",
|
|
6
|
+
"dev": "nodemon --watch src --ext ts --ignore src/system/_routes/tsoa_routes.ts --ignore src/openapi/ --exec \"tsoa spec-and-routes && ts-node src/server.ts\"",
|
|
7
|
+
"openapi": "tsoa spec-and-routes",
|
|
8
|
+
"docker-build": "docker build -t very-express .",
|
|
9
|
+
"docker-start": "docker run -p 3000:3000 very-express"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"cookie": "^0.6.0",
|
|
13
|
+
"cookie-parser": "^1.4.6",
|
|
14
|
+
"dotenv": "^16.4.4",
|
|
15
|
+
"express": "^4.18.2",
|
|
16
|
+
"firebase-admin": "^14.1.0",
|
|
17
|
+
"helmet": "^7.1.0",
|
|
18
|
+
"js-yaml": "^4.1.0",
|
|
19
|
+
"jsonwebtoken": "^9.0.2",
|
|
20
|
+
"passport": "^0.7.0",
|
|
21
|
+
"passport-github": "^1.1.0",
|
|
22
|
+
"passport-google-oauth20": "^2.0.0",
|
|
23
|
+
"passport-jwt": "^4.0.1",
|
|
24
|
+
"pg": "^8.20.0",
|
|
25
|
+
"reflect-metadata": "^0.2.2",
|
|
26
|
+
"swagger-ui-express": "^5.0.0",
|
|
27
|
+
"tsoa": "^7.0.0-alpha.0",
|
|
28
|
+
"typeorm": "^0.3.20"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/cookie-parser": "^1.4.7",
|
|
32
|
+
"@types/crypto-js": "^4.1.2",
|
|
33
|
+
"@types/dotenv": "^8.2.0",
|
|
34
|
+
"@types/express": "^4.17.17",
|
|
35
|
+
"@types/js-yaml": "^4.0.9",
|
|
36
|
+
"@types/jsonwebtoken": "^9.0.7",
|
|
37
|
+
"@types/mongodb": "^4.0.7",
|
|
38
|
+
"@types/ms": "^2.1.0",
|
|
39
|
+
"@types/node": "^20.4.2",
|
|
40
|
+
"@types/passport": "^1.0.16",
|
|
41
|
+
"@types/passport-github": "^1.1.12",
|
|
42
|
+
"@types/passport-google-oauth20": "^2.0.14",
|
|
43
|
+
"@types/pg": "^8.11.0",
|
|
44
|
+
"@types/swagger-ui-express": "^4.1.6",
|
|
45
|
+
"@types/ws": "^8.5.5",
|
|
46
|
+
"nodemon": "^2.0.22",
|
|
47
|
+
"strip-json-comments": "^5.0.1",
|
|
48
|
+
"ts-node": "^10.9.1",
|
|
49
|
+
"typescript": "^5.1.6"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Self-service account deletion page.
|
|
2
|
+
//
|
|
3
|
+
// Sends the access token the same way the rest of the app does — Authorization + X-Auth-Index —
|
|
4
|
+
// and clears the stored tokens on success, because the account is gone the moment the tombstone
|
|
5
|
+
// is written: keeping a token the server will now reject only produces confusing 401s.
|
|
6
|
+
|
|
7
|
+
// The page loads this script from <head>, so it must wait for the DOM: at parse time the
|
|
8
|
+
// button does not exist yet and getElementById would return null.
|
|
9
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
10
|
+
var button = document.getElementById("deleteAccountBtn");
|
|
11
|
+
var input = document.getElementById("confirmInput");
|
|
12
|
+
var result = document.getElementById("deleteResult");
|
|
13
|
+
|
|
14
|
+
if (!button || !input || !result) return;
|
|
15
|
+
|
|
16
|
+
function clearTokens() {
|
|
17
|
+
localStorage.removeItem("accessToken");
|
|
18
|
+
localStorage.removeItem("accessTokenIndex");
|
|
19
|
+
localStorage.removeItem("refreshToken");
|
|
20
|
+
localStorage.removeItem("refreshTokenIndex");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function render(data) {
|
|
24
|
+
result.textContent = JSON.stringify(data, null, 2);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
button.addEventListener("click", function () {
|
|
28
|
+
if (input.value !== "DELETE") {
|
|
29
|
+
render({ error: 'Type DELETE in the box to confirm.' });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button.disabled = true;
|
|
34
|
+
render({ status: "Deleting…" });
|
|
35
|
+
|
|
36
|
+
fetch("/api/auth/delete-account", {
|
|
37
|
+
method: "POST",
|
|
38
|
+
credentials: "include",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
"Authorization": "Bearer " + (localStorage.getItem("accessToken") || ""),
|
|
42
|
+
"X-Auth-Index": localStorage.getItem("accessTokenIndex") || "",
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
.then(function (response) {
|
|
46
|
+
// read as text first: an error response may not be JSON (a proxy or the
|
|
47
|
+
// express error handler can return HTML), and response.json() would then
|
|
48
|
+
// reject and hide the real status behind a parse error
|
|
49
|
+
return response.text().then(function (text) {
|
|
50
|
+
var body;
|
|
51
|
+
try {
|
|
52
|
+
body = text ? JSON.parse(text) : {};
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
body = { raw: text };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return { ok: response.ok, status: response.status, body: body };
|
|
59
|
+
});
|
|
60
|
+
})
|
|
61
|
+
.then(function (outcome) {
|
|
62
|
+
if (!outcome.ok) {
|
|
63
|
+
render({ status: outcome.status, error: outcome.body });
|
|
64
|
+
button.disabled = false;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
clearTokens();
|
|
69
|
+
render({
|
|
70
|
+
status: "Account deleted. You have been signed out.",
|
|
71
|
+
result: outcome.body,
|
|
72
|
+
});
|
|
73
|
+
input.value = "";
|
|
74
|
+
})
|
|
75
|
+
.catch(function (err) {
|
|
76
|
+
render({ error: String(err) });
|
|
77
|
+
button.disabled = false;
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|