|
@@ -2,57 +2,57 @@ import { useEffect, useState } from 'react';
|
|
|
|
|
|
import { t } from 'i18next';
|
|
import { t } from 'i18next';
|
|
|
|
|
|
|
|
+import {
|
|
|
|
+ decryptAndStoreToken,
|
|
|
|
+ generateAndSaveIntermediateKeyAttributes,
|
|
|
|
+ generateLoginSubKey,
|
|
|
|
+ saveKeyInSessionStore,
|
|
|
|
+} from '@ente/shared/crypto/helpers';
|
|
import {
|
|
import {
|
|
clearData,
|
|
clearData,
|
|
getData,
|
|
getData,
|
|
LS_KEYS,
|
|
LS_KEYS,
|
|
setData,
|
|
setData,
|
|
} from '@ente/shared/storage/localStorage';
|
|
} from '@ente/shared/storage/localStorage';
|
|
-import { PAGES } from '../constants/pages';
|
|
|
|
import {
|
|
import {
|
|
- SESSION_KEYS,
|
|
|
|
getKey,
|
|
getKey,
|
|
removeKey,
|
|
removeKey,
|
|
|
|
+ SESSION_KEYS,
|
|
setKey,
|
|
setKey,
|
|
} from '@ente/shared/storage/sessionStorage';
|
|
} from '@ente/shared/storage/sessionStorage';
|
|
-import {
|
|
|
|
- decryptAndStoreToken,
|
|
|
|
- generateAndSaveIntermediateKeyAttributes,
|
|
|
|
- generateLoginSubKey,
|
|
|
|
- saveKeyInSessionStore,
|
|
|
|
-} from '@ente/shared/crypto/helpers';
|
|
|
|
|
|
+import { PAGES } from '../constants/pages';
|
|
import { generateSRPSetupAttributes } from '../services/srp';
|
|
import { generateSRPSetupAttributes } from '../services/srp';
|
|
import { logoutUser } from '../services/user';
|
|
import { logoutUser } from '../services/user';
|
|
|
|
|
|
-import { configureSRP, loginViaSRP } from '../services/srp';
|
|
|
|
-import { getSRPAttributes } from '../api/srp';
|
|
|
|
-import { SRPAttributes } from '../types/srp';
|
|
|
|
-
|
|
|
|
-import {
|
|
|
|
- isFirstLogin,
|
|
|
|
- setIsFirstLogin,
|
|
|
|
-} from '@ente/shared/storage/localStorage/helpers';
|
|
|
|
-import { KeyAttributes, User } from '@ente/shared/user/types';
|
|
|
|
|
|
+import { VerticallyCentered } from '@ente/shared/components/Container';
|
|
|
|
+import EnteSpinner from '@ente/shared/components/EnteSpinner';
|
|
import FormPaper from '@ente/shared/components/Form/FormPaper';
|
|
import FormPaper from '@ente/shared/components/Form/FormPaper';
|
|
-import FormPaperTitle from '@ente/shared/components/Form/FormPaper/Title';
|
|
|
|
import FormPaperFooter from '@ente/shared/components/Form/FormPaper/Footer';
|
|
import FormPaperFooter from '@ente/shared/components/Form/FormPaper/Footer';
|
|
|
|
+import FormPaperTitle from '@ente/shared/components/Form/FormPaper/Title';
|
|
import LinkButton from '@ente/shared/components/LinkButton';
|
|
import LinkButton from '@ente/shared/components/LinkButton';
|
|
-import isElectron from 'is-electron';
|
|
|
|
-import { VerticallyCentered } from '@ente/shared/components/Container';
|
|
|
|
-import EnteSpinner from '@ente/shared/components/EnteSpinner';
|
|
|
|
import VerifyMasterPasswordForm, {
|
|
import VerifyMasterPasswordForm, {
|
|
VerifyMasterPasswordFormProps,
|
|
VerifyMasterPasswordFormProps,
|
|
} from '@ente/shared/components/VerifyMasterPasswordForm';
|
|
} from '@ente/shared/components/VerifyMasterPasswordForm';
|
|
|
|
+import { getAccountsURL } from '@ente/shared/network/api';
|
|
|
|
+import {
|
|
|
|
+ isFirstLogin,
|
|
|
|
+ setIsFirstLogin,
|
|
|
|
+} from '@ente/shared/storage/localStorage/helpers';
|
|
|
|
+import { KeyAttributes, User } from '@ente/shared/user/types';
|
|
|
|
+import isElectron from 'is-electron';
|
|
|
|
+import { getSRPAttributes } from '../api/srp';
|
|
|
|
+import { configureSRP, loginViaSRP } from '../services/srp';
|
|
|
|
+import { SRPAttributes } from '../types/srp';
|
|
// import { APPS, getAppName } from '@ente/shared/apps';
|
|
// import { APPS, getAppName } from '@ente/shared/apps';
|
|
-import { addLocalLog } from '@ente/shared/logging';
|
|
|
|
|
|
+import { APP_HOMES } from '@ente/shared/apps/constants';
|
|
|
|
+import { PageProps } from '@ente/shared/apps/types';
|
|
import ComlinkCryptoWorker from '@ente/shared/crypto';
|
|
import ComlinkCryptoWorker from '@ente/shared/crypto';
|
|
import { B64EncryptionResult } from '@ente/shared/crypto/types';
|
|
import { B64EncryptionResult } from '@ente/shared/crypto/types';
|
|
|
|
+import ElectronAPIs from '@ente/shared/electron';
|
|
import { CustomError } from '@ente/shared/error';
|
|
import { CustomError } from '@ente/shared/error';
|
|
-import InMemoryStore, { MS_KEYS } from '@ente/shared/storage/InMemoryStore';
|
|
|
|
-import { PageProps } from '@ente/shared/apps/types';
|
|
|
|
-import { APP_HOMES } from '@ente/shared/apps/constants';
|
|
|
|
|
|
+import { addLocalLog } from '@ente/shared/logging';
|
|
import { logError } from '@ente/shared/sentry';
|
|
import { logError } from '@ente/shared/sentry';
|
|
-import ElectronAPIs from '@ente/shared/electron';
|
|
|
|
|
|
+import InMemoryStore, { MS_KEYS } from '@ente/shared/storage/InMemoryStore';
|
|
|
|
|
|
export default function Credentials({
|
|
export default function Credentials({
|
|
appContext,
|
|
appContext,
|
|
@@ -166,7 +166,8 @@ export default function Credentials({
|
|
isTwoFactorPasskeysEnabled: true,
|
|
isTwoFactorPasskeysEnabled: true,
|
|
});
|
|
});
|
|
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.ROOT);
|
|
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.ROOT);
|
|
- window.location.href = `${process.env.NEXT_PUBLIC_ACCOUNTS_ENDPOINT}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${window.location.origin}/passkeys/finish`;
|
|
|
|
|
|
+ window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${window.location.origin
|
|
|
|
+ }/passkeys/finish`;
|
|
return;
|
|
return;
|
|
} else if (twoFactorSessionID) {
|
|
} else if (twoFactorSessionID) {
|
|
const sessionKeyAttributes =
|
|
const sessionKeyAttributes =
|