Compare commits

...

2 Commits

Author SHA1 Message Date
Timo K
91e1cc7488 not call registerPasswordlessUser where its called in a widget.
Signed-off-by: Timo K <toger5@hotmail.de>
2024-02-21 15:22:48 +01:00
Timo K
c2d3e19c48 dont register in widget mode
Signed-off-by: Timo K <toger5@hotmail.de>
2024-01-24 17:24:39 +01:00
2 changed files with 8 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import { useClient } from "../ClientContext";
import { useInteractiveRegistration } from "../auth/useInteractiveRegistration";
import { generateRandomName } from "../auth/generateRandomName";
import { useRecaptcha } from "../auth/useRecaptcha";
import { widget } from "../widget";
interface UseRegisterPasswordlessUserType {
privacyPolicyUrl?: string;
@@ -39,6 +40,11 @@ export function useRegisterPasswordlessUser(): UseRegisterPasswordlessUserType {
if (!setClient) {
throw new Error("No client context");
}
if (widget) {
throw new Error(
"Registration was skipped: We should never try to register password-less user in embedded mode.",
);
}
try {
const recaptchaResponse = await execute();

View File

@@ -29,6 +29,7 @@ import { useOptInAnalytics } from "../settings/useSetting";
import { HomePage } from "../home/HomePage";
import { platform } from "../Platform";
import { AppSelectionModal } from "./AppSelectionModal";
import { widget } from "../widget";
export const RoomPage: FC = () => {
const {
@@ -62,7 +63,7 @@ export const RoomPage: FC = () => {
useEffect(() => {
// If we've finished loading, are not already authed and we've been given a display name as
// a URL param, automatically register a passwordless user
if (!loading && !authenticated && displayName) {
if (!loading && !authenticated && displayName && !widget) {
setIsRegistering(true);
registerPasswordlessUser(displayName).finally(() => {
setIsRegistering(false);