Skip to content

Commit 8f70674

Browse files
committed
update: makes handling non-public properties generic
1 parent 80176d9 commit 8f70674

File tree

13 files changed

+199
-184
lines changed

13 files changed

+199
-184
lines changed

lib/build/index.js

Lines changed: 14 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/recipe/dashboard/api/multitenancy/getThirdPartyConfig.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ async function getThirdPartyConfig(_, tenantId, options, userContext) {
130130
authorizationEndpoint: undefined,
131131
tokenEndpoint: undefined,
132132
userInfoEndpoint: undefined,
133-
clients: ((_c = staticProviders[0].config.clients) !== null && _c !== void 0 ? _c : []).map(
134-
(client) =>
135-
Object.assign(Object.assign({}, client), {
136-
additionalConfig: Object.assign(
137-
Object.assign({}, client.additionalConfig),
138-
additionalConfig
139-
),
140-
})
133+
clients: ((_c = staticProviders[0].config.clients) !== null && _c !== void 0
134+
? _c
135+
: []
136+
).map((client) =>
137+
Object.assign(Object.assign({}, client), {
138+
additionalConfig: Object.assign(
139+
Object.assign({}, client.additionalConfig),
140+
additionalConfig
141+
),
142+
})
141143
),
142144
}),
143145
});

lib/build/recipe/emailpassword/index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,17 @@ class Wrapper {
112112
});
113113
}
114114
static updateEmailOrPassword(input) {
115-
return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.updateEmailOrPassword(
116-
Object.assign(Object.assign({}, input), {
117-
userContext: (0, utils_2.getUserContext)(input.userContext),
118-
tenantIdForPasswordPolicy:
119-
input.tenantIdForPasswordPolicy === undefined
120-
? constants_1.DEFAULT_TENANT_ID
121-
: input.tenantIdForPasswordPolicy,
122-
})
123-
);
115+
return recipe_1.default
116+
.getInstanceOrThrowError()
117+
.recipeInterfaceImpl.updateEmailOrPassword(
118+
Object.assign(Object.assign({}, input), {
119+
userContext: (0, utils_2.getUserContext)(input.userContext),
120+
tenantIdForPasswordPolicy:
121+
input.tenantIdForPasswordPolicy === undefined
122+
? constants_1.DEFAULT_TENANT_ID
123+
: input.tenantIdForPasswordPolicy,
124+
})
125+
);
124126
}
125127
static async createResetPasswordLink(tenantId, userId, email, userContext) {
126128
const ctx = (0, utils_2.getUserContext)(userContext);

lib/build/recipe/passwordless/index.js

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ const __1 = require("../..");
2626
const utils_1 = require("../../utils");
2727
class Wrapper {
2828
static createCode(input) {
29-
return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.createCode(
30-
Object.assign(Object.assign({}, input), {
31-
session: input.session,
32-
shouldTryLinkingWithSessionUser: !!input.session,
33-
userContext: (0, utils_1.getUserContext)(input.userContext),
34-
})
35-
);
29+
return recipe_1.default
30+
.getInstanceOrThrowError()
31+
.recipeInterfaceImpl.createCode(
32+
Object.assign(Object.assign({}, input), {
33+
session: input.session,
34+
shouldTryLinkingWithSessionUser: !!input.session,
35+
userContext: (0, utils_1.getUserContext)(input.userContext),
36+
})
37+
);
3638
}
3739
static createNewCodeForDevice(input) {
3840
return recipe_1.default
@@ -42,13 +44,15 @@ class Wrapper {
4244
);
4345
}
4446
static consumeCode(input) {
45-
return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.consumeCode(
46-
Object.assign(Object.assign({}, input), {
47-
session: input.session,
48-
shouldTryLinkingWithSessionUser: !!input.session,
49-
userContext: (0, utils_1.getUserContext)(input.userContext),
50-
})
51-
);
47+
return recipe_1.default
48+
.getInstanceOrThrowError()
49+
.recipeInterfaceImpl.consumeCode(
50+
Object.assign(Object.assign({}, input), {
51+
session: input.session,
52+
shouldTryLinkingWithSessionUser: !!input.session,
53+
userContext: (0, utils_1.getUserContext)(input.userContext),
54+
})
55+
);
5256
}
5357
/**
5458
* This function will only verify the code (not consume it), and:
@@ -115,12 +119,14 @@ class Wrapper {
115119
}
116120
static createMagicLink(input) {
117121
const ctx = (0, utils_1.getUserContext)(input.userContext);
118-
return recipe_1.default.getInstanceOrThrowError().createMagicLink(
119-
Object.assign(Object.assign({}, input), {
120-
request: (0, __1.getRequestFromUserContext)(ctx),
121-
userContext: ctx,
122-
})
123-
);
122+
return recipe_1.default
123+
.getInstanceOrThrowError()
124+
.createMagicLink(
125+
Object.assign(Object.assign({}, input), {
126+
request: (0, __1.getRequestFromUserContext)(ctx),
127+
userContext: ctx,
128+
})
129+
);
124130
}
125131
static signInUp(input) {
126132
return recipe_1.default

lib/build/supertokens.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/types.d.ts

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/types.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/utils.d.ts

Lines changed: 22 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)