Skip to content

Commit

Permalink
Merge branch '0.48' into ci/use-circle-ci-tests-for-partial-rerun-sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
porcellus authored Dec 4, 2024
2 parents 946a26c + 74f4bed commit 8d80c71
Show file tree
Hide file tree
Showing 56 changed files with 250 additions and 213 deletions.
2 changes: 1 addition & 1 deletion docs/classes/index.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_authRecipe.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_emailpassword.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_emailverification.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_multifactorauth.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_multitenancy.default.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/recipe_oauth2provider.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_passwordless.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_recipeModule.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_session.BooleanClaim.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_session.PrimitiveArrayClaim.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_session.PrimitiveClaim.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_session.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.ActiveDirectory.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Apple.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Bitbucket.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.BoxySAML.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Discord.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Facebook.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Github.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Gitlab.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Google.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.GoogleWorkspaces.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.LinkedIn.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Okta.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Twitter.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_totp.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_userroles.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/recipe_emailpassword.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/recipe_emailverification.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/recipe_multifactorauth.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/recipe_multitenancy.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/recipe_oauth2provider.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/recipe_passwordless.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/recipe_session.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/modules/recipe_thirdparty.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modules/recipe_totp.html

Large diffs are not rendered by default.

84 changes: 43 additions & 41 deletions examples/for-tests-react-16/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,50 +272,52 @@ if (testContext.enableMFA) {
);
}

SuperTokens.init({
usesDynamicLoginMethods: testContext.usesDynamicLoginMethods,
clientType: testContext.clientType,
appInfo: {
appName: "SuperTokens",
websiteDomain: getWebsiteDomain(),
apiDomain: getApiDomain(),
websiteBasePath,
},
languageTranslations: {
translations: {
en: {
AUTH_PAGE_FOOTER_TOS: "TOS",
},
hu: {
AUTH_PAGE_FOOTER_TOS: "ÁSZF",
if (!window.location.pathname.startsWith("/mockProvider")) {
SuperTokens.init({
usesDynamicLoginMethods: testContext.usesDynamicLoginMethods,
clientType: testContext.clientType,
appInfo: {
appName: "SuperTokens",
websiteDomain: getWebsiteDomain(),
apiDomain: getApiDomain(),
websiteBasePath,
},
languageTranslations: {
translations: {
en: {
AUTH_PAGE_FOOTER_TOS: "TOS",
},
hu: {
AUTH_PAGE_FOOTER_TOS: "ÁSZF",
},
},
},
},
getRedirectionURL: (context) => {
if (context.action === "SUCCESS") {
let logId = {
emailpassword: "EMAIL_PASSWORD",
thirdparty: "THIRD_PARTY",
passwordless: "PASSWORDLESS",
}[context.recipeId];

console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`);
setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser);
if (testContext.disableRedirectionAfterSuccessfulSignInUp) {
return null;
getRedirectionURL: (context) => {
if (context.action === "SUCCESS") {
let logId = {
emailpassword: "EMAIL_PASSWORD",
thirdparty: "THIRD_PARTY",
passwordless: "PASSWORDLESS",
}[context.recipeId];

console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`);
setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser);
if (testContext.disableRedirectionAfterSuccessfulSignInUp) {
return null;
}
return context.redirectToPath || "/dashboard";
} else {
console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`);
}
return context.redirectToPath || "/dashboard";
} else {
console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`);
}
},
useShadowDom,
privacyPolicyLink: "https://supertokens.com/legal/privacy-policy",
termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions",
defaultToSignUp,
disableAuthRoute: testContext.disableDefaultUI,
recipeList,
});
},
useShadowDom,
privacyPolicyLink: "https://supertokens.com/legal/privacy-policy",
termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions",
defaultToSignUp,
disableAuthRoute: testContext.disableDefaultUI,
recipeList,
});
}

/* App */
function App() {
Expand Down
93 changes: 47 additions & 46 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,55 +439,56 @@ if (testContext.enableMFA) {
})
);
}

SuperTokens.init({
usesDynamicLoginMethods: testContext.usesDynamicLoginMethods,
clientType: testContext.clientType,
enableDebugLogs: true,
appInfo: {
appName: "SuperTokens",
websiteDomain: getWebsiteDomain(),
apiDomain: getApiDomain(),
websiteBasePath,
},
languageTranslations: {
translations: {
en: {
AUTH_PAGE_FOOTER_TOS: "TOS",
},
hu: {
AUTH_PAGE_FOOTER_TOS: "ÁSZF",
if (!window.location.pathname.startsWith("/mockProvider")) {
SuperTokens.init({
usesDynamicLoginMethods: testContext.usesDynamicLoginMethods,
clientType: testContext.clientType,
enableDebugLogs: true,
appInfo: {
appName: "SuperTokens",
websiteDomain: getWebsiteDomain(),
apiDomain: getApiDomain(),
websiteBasePath,
},
languageTranslations: {
translations: {
en: {
AUTH_PAGE_FOOTER_TOS: "TOS",
},
hu: {
AUTH_PAGE_FOOTER_TOS: "ÁSZF",
},
},
},
},
getRedirectionURL: (context) => {
if (context.action === "SUCCESS") {
let logId = {
emailpassword: "EMAIL_PASSWORD",
thirdparty: "THIRD_PARTY",
passwordless: "PASSWORDLESS",
thirdpartypasswordless: "THIRDPARTYPASSWORDLESS",
thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD",
}[context.recipeId];

console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`);
setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser);
if (testContext.disableRedirectionAfterSuccessfulSignInUp) {
return null;
getRedirectionURL: (context) => {
if (context.action === "SUCCESS") {
let logId = {
emailpassword: "EMAIL_PASSWORD",
thirdparty: "THIRD_PARTY",
passwordless: "PASSWORDLESS",
thirdpartypasswordless: "THIRDPARTYPASSWORDLESS",
thirdpartyemailpassword: "THIRD_PARTY_EMAIL_PASSWORD",
}[context.recipeId];

console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL SUCCESS ${logId}`);
setIsNewUserToStorage(context.recipeId, context.isNewRecipeUser);
if (testContext.disableRedirectionAfterSuccessfulSignInUp) {
return null;
}
console.log(JSON.stringify(context));
return context.redirectToPath || "/dashboard";
} else {
console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`);
}
console.log(JSON.stringify(context));
return context.redirectToPath || "/dashboard";
} else {
console.log(`ST_LOGS SUPERTOKENS GET_REDIRECTION_URL ${context.action}`);
}
},
useShadowDom,
privacyPolicyLink: "https://supertokens.com/legal/privacy-policy",
termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions",
defaultToSignUp,
disableAuthRoute: testContext.disableDefaultUI,
recipeList,
});
},
useShadowDom,
privacyPolicyLink: "https://supertokens.com/legal/privacy-policy",
termsOfServiceLink: "https://supertokens.com/legal/terms-and-conditions",
defaultToSignUp,
disableAuthRoute: testContext.disableDefaultUI,
recipeList,
});
}

/* App */
function App() {
Expand Down
2 changes: 1 addition & 1 deletion lib/build/genericComponentOverrideContext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "0.48.0";
export const package_version = "0.48.1";
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-auth-react",
"version": "0.48.0",
"version": "0.48.1",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down
7 changes: 6 additions & 1 deletion test/end-to-end/emailverification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ describe("SuperTokens Email Verification", function () {
await page.waitForSelector(".sessionInfo-user-id");
await waitForUrl(page, "/dashboard");

await page.evaluate((url) => window.fetch(url), `${TEST_APPLICATION_SERVER_BASE_URL}/unverifyEmail`);
await Promise.all([
page.waitForResponse(
(response) => response.url() === SEND_VERIFY_EMAIL_API && response.status() === 200
),
page.evaluate((url) => window.fetch(url), `${TEST_APPLICATION_SERVER_BASE_URL}/unverifyEmail`),
]);
await waitForSTElement(page, "[data-supertokens~='sendVerifyEmailIcon']");

await waitForUrl(page, "/auth/verify-email");
Expand Down
8 changes: 4 additions & 4 deletions test/end-to-end/generalerror.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
assertProviders,
clickOnProviderButton,
clickOnProviderButtonWithoutWaiting,
loginWithAuth0,
loginWithMockProvider,
isGeneralErrorSupported,
setGeneralErrorToLocalStorage,
backendBeforeEach,
Expand Down Expand Up @@ -403,7 +403,7 @@ function getThirdPartyTests(rid, ridForStorage) {
await assertProviders(page);

let [_, response1] = await Promise.all([
clickOnProviderButtonWithoutWaiting(page, "Auth0"),
clickOnProviderButtonWithoutWaiting(page, "Mock Provider"),
page.waitForResponse(
(response) =>
response.url().includes(GET_AUTH_URL_API) &&
Expand All @@ -428,10 +428,10 @@ function getThirdPartyTests(rid, ridForStorage) {

await page.goto(`${TEST_CLIENT_BASE_URL}/auth`);
await assertProviders(page);
await clickOnProviderButton(page, "Auth0");
await clickOnProviderButton(page, "Mock Provider");

let [_, response1] = await Promise.all([
loginWithAuth0(page),
loginWithMockProvider(page),
page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200),
]);

Expand Down
20 changes: 10 additions & 10 deletions test/end-to-end/getRedirectionURL.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
screenshotOnFailure,
assertProviders,
clickOnProviderButton,
loginWithAuth0,
loginWithMockProvider,
setPasswordlessFlowType,
waitForSTElement,
getPasswordlessDevice,
Expand Down Expand Up @@ -114,9 +114,9 @@ describe("getRedirectionURL Tests", function () {
page.waitForNavigation({ waitUntil: "networkidle0" }),
]);
await assertProviders(page);
await clickOnProviderButton(page, "Auth0");
await clickOnProviderButton(page, "Mock Provider");
await Promise.all([
loginWithAuth0(page),
loginWithMockProvider(page),
page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200),
]);
const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck"));
Expand Down Expand Up @@ -170,9 +170,9 @@ describe("getRedirectionURL Tests", function () {

it("Test that isNewRecipeUser works correctly when signing up with auth 0", async function () {
await assertProviders(page);
await clickOnProviderButton(page, "Auth0");
await clickOnProviderButton(page, "Mock Provider");
await Promise.all([
loginWithAuth0(page),
loginWithMockProvider(page),
page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200),
]);
const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck"));
Expand Down Expand Up @@ -354,9 +354,9 @@ describe("getRedirectionURL Tests", function () {
page.waitForNavigation({ waitUntil: "networkidle0" }),
]);
await assertProviders(page);
await clickOnProviderButton(page, "Auth0");
await clickOnProviderButton(page, "Mock Provider");
await Promise.all([
loginWithAuth0(page),
loginWithMockProvider(page),
page.waitForResponse((response) => response.url() === SIGN_IN_UP_API && response.status() === 200),
]);
const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck"));
Expand Down Expand Up @@ -642,10 +642,10 @@ describe("getRedirectionURL Tests", function () {
]);

await assertProviders(page);
await clickOnProviderButton(page, "Auth0");
await clickOnProviderButton(page, "Mock Provider");

await Promise.all([
loginWithAuth0(page),
loginWithMockProvider(page),
page.waitForResponse(
(response) => response.url() === SIGN_IN_UP_API && response.status() === 200
),
Expand All @@ -654,7 +654,7 @@ describe("getRedirectionURL Tests", function () {
const urlAfterSignUp = await page.url();
const newUserCheck = await page.evaluate(() => localStorage.getItem("isNewUserCheck"));
assert.equal(newUserCheck, "thirdparty-true");
assert(urlAfterSignUp.includes("/auth/callback/auth0"));
assert(urlAfterSignUp.includes("/auth/callback/mock-provider"));
});
});
});
Expand Down
3 changes: 2 additions & 1 deletion test/end-to-end/multitenancy.dynamic_login_methods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ import {
loginWithGoogle,
clearBrowserCookiesWithoutAffectingConsole,
clickOnProviderButton,
loginWithAuth0,
loginWithMockProvider,
isMultitenancySupported,
isMultitenancyManagementEndpointsSupported,
setupTenant,
backendBeforeEach,
getTextByDataSupertokens,
setupBrowser,
loginWithAuth0,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand Down
Loading

0 comments on commit 8d80c71

Please sign in to comment.