@ctx-core/auth0-management 9.0.63 → 9.0.64
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.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/auth0-management",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.64",
|
|
4
4
|
"description": "ctx-core auth0 management api",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"getAll-client-grants-auth0": "./bin/getAll-client-grants-auth0.mjs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ctx-core/auth0": "^34.
|
|
31
|
+
"@ctx-core/auth0": "^34.3.0",
|
|
32
32
|
"@ctx-core/fetch-undici": "^2.1.12",
|
|
33
33
|
"@ctx-core/object": "^22.2.0",
|
|
34
34
|
"@ctx-core/uri": "^12.0.49",
|
|
35
35
|
"auth0": "^2.42.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/auth0": "^2.
|
|
38
|
+
"@types/auth0": "^2.35.0",
|
|
39
39
|
"@types/auth0-js": "^9.14.6",
|
|
40
40
|
"c8": "^7.11.3",
|
|
41
41
|
"check-dts": "^0.6.7",
|
package/src/auth0_audience_.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AUTH0_DOMAIN__ } from '@ctx-core/auth0'
|
|
2
2
|
/** @type {import('./auth0_audience_.d.ts').auth0_audience_} */
|
|
3
3
|
/**
|
|
4
4
|
* @param {import('@ctx-core/object').Ctx}ctx
|
|
5
5
|
* @return {string}
|
|
6
6
|
*/
|
|
7
7
|
export function auth0_audience_(ctx) {
|
|
8
|
-
return `https://${
|
|
8
|
+
return `https://${AUTH0_DOMAIN__(ctx).$}/api/v2/`
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verify_access_token_header_authorization,
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN__ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { query_str_ } from '@ctx-core/uri'
|
|
4
4
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
@@ -12,7 +12,7 @@ export async function get_auth0_v2_client_grants(ctx, params) {
|
|
|
12
12
|
const { query, json } = params
|
|
13
13
|
const auth0_token = await auth0_management_token_(ctx)
|
|
14
14
|
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
15
|
-
const url = `https://${
|
|
15
|
+
const url = `https://${AUTH0_DOMAIN__(ctx).$}/api/v2/client-grants?${query || query_str_(json)}`
|
|
16
16
|
const res = await fetch(url, {
|
|
17
17
|
method: 'GET',
|
|
18
18
|
headers: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verify_access_token_header_authorization,
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN__ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @type {import('auth0-js').Auth0UserProfile}Auth0UserProfile */
|
|
@@ -9,7 +9,7 @@ import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
|
9
9
|
*/
|
|
10
10
|
export async function get_auth0_v2_users_by_email(ctx, params) {
|
|
11
11
|
const { email } = params
|
|
12
|
-
const AUTH0_DOMAIN = params.AUTH0_DOMAIN ||
|
|
12
|
+
const AUTH0_DOMAIN = params.AUTH0_DOMAIN || AUTH0_DOMAIN__(ctx).$
|
|
13
13
|
const auth0_token = await auth0_management_token_(ctx)
|
|
14
14
|
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
15
15
|
const url = `https://${AUTH0_DOMAIN}/api/v2/users-by-email?email=${encodeURIComponent(email)}`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verify_access_token_header_authorization,
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN__ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @typedef {import('auth0').Client}Client */
|
|
@@ -11,7 +11,7 @@ export async function patch_auth0_v2_client(ctx, params) {
|
|
|
11
11
|
const { client_id = process.env.AUTH0_CLIENT_ID, body, json, } = params
|
|
12
12
|
const auth0_token = await auth0_management_token_(ctx)
|
|
13
13
|
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
14
|
-
const url = `https://${
|
|
14
|
+
const url = `https://${AUTH0_DOMAIN__(ctx).$}/api/v2/clients/${client_id}`
|
|
15
15
|
const res = await fetch(url, {
|
|
16
16
|
method: 'PATCH',
|
|
17
17
|
headers: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { verify_access_token_header_authorization,
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN__ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @typedef {import('auth0').UpdateUserData}UpdateUserData */
|
|
@@ -19,7 +19,7 @@ export async function patch_auth0_v2_user(
|
|
|
19
19
|
) {
|
|
20
20
|
const auth0_management_token = await auth0_management_token_(ctx)
|
|
21
21
|
const authorization = verify_access_token_header_authorization(auth0_management_token)
|
|
22
|
-
const url = `https://${
|
|
22
|
+
const url = `https://${AUTH0_DOMAIN__(ctx).$}/api/v2/users/${user_id}`
|
|
23
23
|
const res = await fetch(url, {
|
|
24
24
|
method: 'PATCH',
|
|
25
25
|
headers: {
|