Skip to content

Commit

Permalink
fix: tpep header with disabled emailpassword (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus authored Dec 6, 2023
1 parent 09b9dda commit f2862ef
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 22 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [0.35.9] - 2023-12-06

- Fixes ThirdPartyEmailPassword rendering sign in/up switcher even with disabled email password. Instead it'll now render `SignInAndUpHeader` in this case (overrideable as `ThirdPartySignInAndUpHeader`)

## [0.35.8] - 2023-11-26

- Fixes `inputComponent` props to make them non optional. This is in the context of customizing the sign up form to add custom react components.
Expand Down

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

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

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

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

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

1 change: 1 addition & 0 deletions lib/build/thirdparty-shared2.js

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

16 changes: 10 additions & 6 deletions lib/build/thirdpartyemailpasswordprebuiltui.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.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { SignUpFooter } from "../../../../emailpassword/components/themes/signIn
import { SignUpForm } from "../../../../emailpassword/components/themes/signInAndUp/signUpForm";
import { useDynamicLoginMethods } from "../../../../multitenancy/dynamicLoginMethodsContext";
import { ProvidersForm } from "../../../../thirdparty/components/themes/signInAndUp/providersForm";
import { SignInAndUpHeader } from "../../../../thirdparty/components/themes/signInAndUp/signInAndUpHeader";
import { ThemeBase } from "../themeBase";

import { Header } from "./header";
Expand Down Expand Up @@ -62,10 +63,14 @@ const SignInAndUpTheme: React.FC<ThirdPartyEmailPasswordSignInAndUpThemeProps> =
return (
<div data-supertokens="container">
<div data-supertokens="row">
<Header
isSignUp={props.epState.isSignUp}
setIsSignUp={(isSignUp) => props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })}
/>
{emailPasswordEnabled ? (
<Header
isSignUp={props.epState.isSignUp}
setIsSignUp={(isSignUp) => props.epDispatch({ type: isSignUp ? "setSignUp" : "setSignIn" })}
/>
) : (
<SignInAndUpHeader />
)}
{props.commonState.error && <GeneralError error={props.commonState.error} />}
{props.tpChildProps !== undefined && thirdPartyEnabled && (
<ProvidersForm {...props.tpChildProps} featureState={props.tpState} dispatch={props.tpDispatch} />
Expand Down
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.35.8";
export const package_version = "0.35.9";
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.35.8",
"version": "0.35.9",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions test/end-to-end/multitenancy.dynamic_login_methods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
isMultitenancyManagementEndpointsSupported,
setupTenant,
backendBeforeEach,
getTextByDataSupertokens,
} from "../helpers";
import {
TEST_CLIENT_BASE_URL,
Expand Down Expand Up @@ -530,6 +531,7 @@ describe("SuperTokens Multitenancy dynamic login methods", function () {
// Emailpassword
const inputNames = await getInputNames(page);
assert.deepStrictEqual(inputNames, []);
assert.strictEqual(await getTextByDataSupertokens(page, "headerTitle"), "Sign Up / Sign In");
});

it("should show thirdpartyemailpassword if FE has tpep and both emailpassword and thirdparty is enabled", async function () {
Expand Down

0 comments on commit f2862ef

Please sign in to comment.