Skip to content

Commit

Permalink
Merge branch '0.47' into feat/oauth2/base
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Oct 3, 2024
2 parents 791f93e + 0df1b50 commit 5801460
Show file tree
Hide file tree
Showing 166 changed files with 2,534 additions and 1,517 deletions.
5 changes: 4 additions & 1 deletion .circleci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ then
cd ..
npm publish --tag latest
npm i || exit $?
npx -y chromatic --auto-accept-changes master
npx -y chromatic --auto-accept-changes --branch=master
npx -y chromatic --auto-accept-changes --branch=$version
else
cd ..
npm publish --tag version-$version
npm i || exit $?
npx -y chromatic --auto-accept-changes --branch=$version
fi
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Chromatic"
on:
push:
branches: [master, "[0-9]*.[0-9]*"]
workflow_call:
workflow_dispatch:

jobs:
chromatic:
Expand Down
86 changes: 84 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.44.0] - 2024-10-07
## [0.49.0] - 2024-10-07

### Changes

Expand Down Expand Up @@ -92,7 +92,89 @@ Passwordless.init({
});
```

## [0.43.0] - 2024-10-07
## [0.47.1] - 2024-09-18

### Fixes

- Fixed an issue where we showed the "continue with passwordless" button during sign-in even if email-based passwordless was disabled by the tenant configuration.

## [0.47.0] - 2024-09-02

### Breaking changes

Redesigned the pre-built UI with a modern monochrome aesthetic, creating a cleaner and more unified visual experience. Please double check any custom styles you added still looks good with the new UI.

### Details

- Changed a lot of the default styles to fit the new UI
- `--palette-textTitle` changed from `rgb(34, 34, 34)` to `rgb(0, 0, 0)`
- `--palette-textLabel` changed from rgb`(34, 34, 34)` to `rgb(0, 0, 0)`
- `--palette-textInput` changed from `rgb(34, 34, 34)` to `rgb(0, 0, 0)`
- `--palette-textPrimary` changed from `rgb(101, 101, 101)` to `rgb(128, 128, 128)`
- `--palette-textLink` changed from `rgb(0, 118, 255)` to `rgb(0, 122, 255)`
- `--palette-textGray` changed from `rgb(128, 128, 128)` to `rgb(54, 54, 54)`
- Adjusted the layout of the provider buttons. Now:
- The logo is aligned to the left, and the text is centered within the entire button, enhancing visual balance and consistency across different button text lengths.
- The button now has a fixed height of 40px.
- We add an animation to the button when hovering over it if the text is too long.
- Changed the Email Icon used in the "Verify Email" UI
- Changed the SMS Icon used in the "Link sent to phone" UI
- Changed the button arrow icons
- Updated some translation strings to fit the new UI
- `EMAIL_VERIFICATION_SEND_TITLE`
- `PWLESS_LINK_SENT_RESEND_DESC_END_EMAIL`

## [0.46.0] - 2024-08-26

### Breaking changes

- The prebuilt UI now clears the login attempt info if the stored data doesn't contain all the required properties. This should help migration from a custom UI to the prebuilt UI.
- Changed `redirectToFactor` to accept an object instead of multiple arguments.
- Changed `redirectToFactorChooser` to accept an object instead of multiple arguments.
- Made MFA related screens do a success redirection if MFA is already completed and the `stepUp` query param is not set to `true`.
- `redirectToFactorChooser` now accepts a `stepUp` option to set the `stepUp` query param.
- `redirectToFactor` now accepts a `stepUp` option to set the `stepUp` query param.

### Fixes

- Fixed an issue where the `Session` recipe was not allowed in the pre-built UI list (it's still a no-op, but it shouldn't be a type issue)

## [0.45.1] - 2024-08-09

### Changes

- Now we only update the session context if the object changes by value. This optimization should help reduce unnecessary re-renders.

## [0.45.0] - 2024-07-31

### Breaking changes

- Updated the font and font-weights in the default styles
- We no longer load the Rubik font by default

### Fixes

- Now the error prop should be updated in override components.

## [0.44.0] - 2024-07-15

- Removes the default `maxAgeInSeconds` value (previously 300 seconds) in EmailVerification Claim. If the claim value is true and `maxAgeInSeconds` is not provided, it will not be refreshed.

## [0.43.1] - 2024-07-15

- Fixes to e2e test

## [0.43.0] - 2024-06-25

### Changes

- Updated SAML third-party provider to use logo based on the provider name

## [0.42.3] - 2024-06-24

### Changes

- Now we only update the session context if the object changes by value. This optimization should help reduce unnecessary re-renders.

## [0.42.2] - 2024-05-29

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/dateProvider.DateProviderReference.html

Large diffs are not rendered by default.

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.

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.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 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.

16 changes: 8 additions & 8 deletions docs/modules/recipe_emailpassword.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 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.

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

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions docs/modules/recipe_passwordless.html

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

20 changes: 10 additions & 10 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.

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

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/for-tests-react-16/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: stretch;
width: 100vw;
height: 100vh;
font-family: Rubik;
}

.fill {
Expand Down
18 changes: 15 additions & 3 deletions examples/for-tests-react-16/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,20 @@ export const DashboardNoAuthRequired = doNotUseReactRouterDom
export function DashboardNoAuthRequiredHelper(props) {
let sessionContext = useSessionContext();

useEffect(() => {
if (testContext.signoutOnSessionNotExists) {
if (!sessionContext.loading && !sessionContext.doesSessionExist) {
Session.signOut();
}
}
}, [sessionContext]);

if (sessionContext.loading) {
return null;
}

if (sessionContext.doesSessionExist) {
return Dashboard({ redirectOnLogout: false, ...props });
return <Dashboard redirectOnLogout={false} {...props} />;
} else {
return <div className="not-logged-in">Not logged in</div>;
}
Expand Down Expand Up @@ -506,9 +514,13 @@ export function DashboardHelper({ redirectOnLogout, ...props } = {}) {
<a
className="goToFactorChooser"
onClick={() => {
return MultiFactorAuth.redirectToFactorChooser(true, undefined, props.history);
return MultiFactorAuth.redirectToFactorChooser({
redirectBack: true,
stepUp: true,
navigate: props.history,
});
}}>
MFA chooser
MFA chooser (step up)
</a>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions examples/for-tests-react-16/src/testContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function getTestContext() {
: undefined,
enableMFA: localStorage.getItem("enableMFA") === "true",
defaultToEmail: localStorage.getItem("defaultToEmail") !== "false",
signoutOnSessionNotExists: localStorage.getItem("signoutOnSessionNotExists") === "true",
disableRedirectionAfterSuccessfulSignInUp:
localStorage.getItem("disableRedirectionAfterSuccessfulSignInUp") === "true",
};
Expand Down
1 change: 0 additions & 1 deletion examples/for-tests/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
justify-content: stretch;
width: 100vw;
height: 100vh;
font-family: Rubik;
}

.fill {
Expand Down
18 changes: 15 additions & 3 deletions examples/for-tests/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,20 @@ export const DashboardNoAuthRequired = doNotUseReactRouterDom
export function DashboardNoAuthRequiredHelper(props) {
let sessionContext = useSessionContext();

useEffect(() => {
if (testContext.signoutOnSessionNotExists) {
if (!sessionContext.loading && !sessionContext.doesSessionExist) {
Session.signOut();
}
}
}, [sessionContext]);

if (sessionContext.loading) {
return null;
}

if (sessionContext.doesSessionExist) {
return Dashboard({ redirectOnLogout: false, ...props });
return <Dashboard redirectOnLogout={false} {...props} />;
} else {
return <div className="not-logged-in">Not logged in</div>;
}
Expand Down Expand Up @@ -670,9 +678,13 @@ export function DashboardHelper({ redirectOnLogout, ...props } = {}) {
<a
className="goToFactorChooser"
onClick={() => {
return MultiFactorAuth.redirectToFactorChooser(true, undefined, props.history);
return MultiFactorAuth.redirectToFactorChooser({
redirectBack: true,
stepUp: true,
navigate: props.history,
});
}}>
MFA chooser
MFA chooser (step up)
</a>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions examples/for-tests/src/testContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function getTestContext() {
},
enableMFA: localStorage.getItem("enableMFA") === "true",
defaultToEmail: localStorage.getItem("defaultToEmail") !== "false",
signoutOnSessionNotExists: localStorage.getItem("signoutOnSessionNotExists") === "true",
disableRedirectionAfterSuccessfulSignInUp:
localStorage.getItem("disableRedirectionAfterSuccessfulSignInUp") === "true",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.1",
"supertokens-auth-react": "latest",
"supertokens-auth-react": "github:supertokens/supertokens-auth-react#feat/mfa_redirect",
"supertokens-web-js": "latest",
"typescript": "^4.8.2",
"web-vitals": "^2.1.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export default function CallAPIView() {
}

async function goToPhoneSetup() {
await MultiFactorAuth.redirectToFactor(MultiFactorAuth.FactorIds.OTP_PHONE, true, true, navigate);
await MultiFactorAuth.redirectToFactor({
factorId: MultiFactorAuth.FactorIds.OTP_PHONE,
forceSetup: true,
redirectBack: true,
navigate,
});
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ export default function SelectPhone() {
if (res.status === 200) {
const loadedInfo = await res.clone().json();
if (loadedInfo.user.phoneNumbers.length === 0) {
await MultiFactorAuth.redirectToFactor(MultiFactorAuth.FactorIds.OTP_PHONE, true, false, nav);
await MultiFactorAuth.redirectToFactor({
factorId: MultiFactorAuth.FactorIds.OTP_PHONE,
forceSetup: true,
redirectBack: false,
navigate: nav,
});
} else if (loadedInfo.user.phoneNumbers.length === 1) {
await Passwordless.createCode({ phoneNumber: loadedInfo.user.phoneNumbers[0] });
await MultiFactorAuth.redirectToFactor(MultiFactorAuth.FactorIds.OTP_PHONE, false, false, nav);
await MultiFactorAuth.redirectToFactor({
factorId: MultiFactorAuth.FactorIds.OTP_PHONE,
redirectBack: false,
navigate: nav,
});
} else {
setUserInfo(loadedInfo);
}
Expand Down Expand Up @@ -65,12 +74,11 @@ export default function SelectPhone() {
hasOtherPhoneNumbers: true,
},
});
return MultiFactorAuth.redirectToFactor(
MultiFactorAuth.FactorIds.OTP_PHONE,
false,
false,
nav
);
return MultiFactorAuth.redirectToFactor({
factorId: MultiFactorAuth.FactorIds.OTP_PHONE,
redirectBack: false,
navigate: nav,
});
}
})
.catch(setError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export default function RecoveryCode() {
if (reset.data.status !== "OK") {
setError("Recovery code not found");
} else {
await MultiFactorAuth.redirectToFactor("totp", true, false, nav);
await MultiFactorAuth.redirectToFactor({
factorId: "totp",
forceSetup: true,
redirectBack: false,
navigate: nav,
});
}
}

Expand Down
15 changes: 3 additions & 12 deletions lib/build/arrowLeftIcon.js

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

Loading

0 comments on commit 5801460

Please sign in to comment.