mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
refactor: remove dead code (#3337)
This commit is contained in:
1 parent
a19002652b
commit
93d1f8af46
1527 files changed
+21170
-73846
No files matched your search
@@ -261,7 +261,7 @@ function tokenBody(token: string): {token: string} {
|
||||
return {token};
|
||||
}
|
||||
|
||||
export class MalformedIpAuthorizationChallengeError extends HttpError {
|
||||
class MalformedIpAuthorizationChallengeError extends HttpError {
|
||||
constructor(error: HttpError) {
|
||||
super({
|
||||
method: error.method,
|
||||
|
||||
@@ -23,10 +23,6 @@ async function requestAuthorizations(): Promise<Array<OAuth2Authorization>> {
|
||||
return response.body;
|
||||
}
|
||||
|
||||
async function requestAuthorizationRemoval(applicationId: string): Promise<void> {
|
||||
await http.delete(Endpoints.OAUTH_AUTHORIZATION(applicationId));
|
||||
}
|
||||
|
||||
async function requestAuthorizationBulkRemoval(applicationIds: Array<string>): Promise<void> {
|
||||
await http.post(Endpoints.OAUTH_AUTHORIZATIONS_REVOKE, {
|
||||
body: {
|
||||
@@ -48,14 +44,6 @@ export async function listAuthorizations(): Promise<Array<OAuth2Authorization>>
|
||||
}
|
||||
}
|
||||
|
||||
export async function deauthorize(applicationId: string): Promise<void> {
|
||||
try {
|
||||
await requestAuthorizationRemoval(applicationId);
|
||||
} catch (error) {
|
||||
rethrowAuthorizationFailure('Failed to deauthorize application:', error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function deauthorizeMany(applicationIds: Array<string>): Promise<void> {
|
||||
try {
|
||||
await requestAuthorizationBulkRemoval(applicationIds);
|
||||
|
||||
@@ -388,7 +388,7 @@ const EmailClaimAccountModal = observer(() => {
|
||||
</Modal.Root>
|
||||
);
|
||||
});
|
||||
export const ClaimAccountModal = observer(() =>
|
||||
const ClaimAccountModal = observer(() =>
|
||||
RuntimeConfig.usesUsernameSignIn ? (
|
||||
<UsernameClaimAccountModal data-flx="auth.claim-account-modal.username-claim-account-modal" />
|
||||
) : (
|
||||
|
||||
@@ -52,7 +52,7 @@ interface FormInputs {
|
||||
pin: string;
|
||||
}
|
||||
|
||||
export const PasskeyPinModal = observer(
|
||||
const PasskeyPinModal = observer(
|
||||
({onSubmit, onDismiss}: {onSubmit: (pin: string) => Promise<void>; onDismiss: () => void}) => {
|
||||
const {i18n} = useLingui();
|
||||
const form = useForm<FormInputs>();
|
||||
|
||||
@@ -118,7 +118,7 @@ const RECOVERY_KIT_BACKUP_CODES_FAILED_DESCRIPTOR = msg({
|
||||
comment: 'Toast shown when the two-factor backup codes for the recovery kit cannot be loaded.',
|
||||
});
|
||||
|
||||
export type RecoveryKitModalReason = 'created' | 'replaced' | 'recovered';
|
||||
type RecoveryKitModalReason = 'created' | 'replaced' | 'recovered';
|
||||
|
||||
export interface RecoveryKitModalProps {
|
||||
recoveryKey: string;
|
||||
@@ -207,7 +207,7 @@ const RecoveryKitPrintView = ({sheet, qrDataUrl}: {sheet: RecoveryKitSheet; qrDa
|
||||
document.body,
|
||||
);
|
||||
|
||||
export const RecoveryKitModal = observer(
|
||||
const RecoveryKitModal = observer(
|
||||
({recoveryKey, createdAt, username, discriminator, reason = 'created', onDone}: RecoveryKitModalProps) => {
|
||||
const {i18n} = useLingui();
|
||||
const currentUser = Users.currentUser;
|
||||
|
||||
@@ -40,18 +40,6 @@
|
||||
color: var(--accent-danger);
|
||||
}
|
||||
|
||||
.srOnly {
|
||||
position: absolute;
|
||||
width: 0.0625rem;
|
||||
height: 0.0625rem;
|
||||
padding: 0;
|
||||
margin: -0.0625rem;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.passkeyHint {
|
||||
margin: 0;
|
||||
font-size: 0.8125rem;
|
||||
|
||||
@@ -69,28 +69,6 @@
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.primaryButton {
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
border-radius: 0.625rem;
|
||||
border: none;
|
||||
background: var(--accent-primary);
|
||||
color: var(--text-on-brand-primary);
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
cursor: pointer;
|
||||
transition: background 120ms ease;
|
||||
}
|
||||
|
||||
.primaryButton:disabled {
|
||||
opacity: 0.7;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.primaryButton:hover:not(:disabled) {
|
||||
background: var(--accent-primary);
|
||||
}
|
||||
|
||||
.ssoSubtitle {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
@@ -137,197 +115,6 @@
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.mfaDescription {
|
||||
margin-bottom: 2rem;
|
||||
text-align: center;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.mfaWebAuthnSection {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.forgotLink {
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
|
||||
.accountSection {
|
||||
margin-top: 2rem;
|
||||
padding-top: 1.5rem;
|
||||
border-top: 0.0625rem solid var(--background-modifier-accent);
|
||||
}
|
||||
|
||||
.accountSectionHeader {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.accountSectionTitle {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin: 0 0 0.25rem 0;
|
||||
}
|
||||
|
||||
.accountSectionSubtitle {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-tertiary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ipAuthContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 2rem 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ipAuthIcon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 4.5rem;
|
||||
height: 4.5rem;
|
||||
border-radius: 50%;
|
||||
background: var(--background-modifier-accent);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.ipAuthActions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.accountList {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.accountCard {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.75rem;
|
||||
background-color: var(--background-secondary);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.accountDetails {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.accountInfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.accountName {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.accountEmail {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.accountMeta {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.accountServer {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.accountActions {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.handoffSuccess {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.handoffCodeSection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin: 1.5rem 0;
|
||||
}
|
||||
|
||||
.handoffCodeLabel {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-tertiary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.handoffCodeDisplay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 1rem 1.5rem;
|
||||
background-color: var(--background-tertiary);
|
||||
border: 0.125rem solid var(--background-modifier-accent);
|
||||
border-radius: 0.75rem;
|
||||
}
|
||||
|
||||
.handoffCodeChar {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: 0.1em;
|
||||
}
|
||||
|
||||
.handoffCodeSeparator {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-tertiary);
|
||||
margin: 0 0.25rem;
|
||||
}
|
||||
|
||||
.handoffSpinner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.75rem;
|
||||
padding: 1.5rem 0;
|
||||
}
|
||||
|
||||
.handoffSpinnerIcon {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
border: 0.1875rem solid var(--background-modifier-accent);
|
||||
border-top-color: var(--brand-primary);
|
||||
border-radius: 50%;
|
||||
animation: handoffSpin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes handoffSpin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
@@ -337,17 +124,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.handoffError {
|
||||
background-color: hsla(0, calc(100% * var(--saturation-factor)), 50%, 0.1);
|
||||
border: 0.0625rem solid hsla(0, calc(100% * var(--saturation-factor)), 50%, 0.2);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
color: var(--status-danger);
|
||||
margin: 1rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ssoCallbackActions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
|
||||
@@ -253,16 +253,6 @@
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.successCard {
|
||||
padding: 0.75rem 0.9rem;
|
||||
border-radius: 0.85rem;
|
||||
background: var(--background-secondary);
|
||||
border: 0.0625rem solid var(--background-modifier-accent);
|
||||
color: var(--text-primary);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.successScreen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
+3
-3
@@ -103,11 +103,11 @@ const OAuthAuthorizeActionsBase: React.FC<OAuthAuthorizeActionsProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const OAuthAuthorizeActions = observer(OAuthAuthorizeActionsBase);
|
||||
const OAuthAuthorizeActions = observer(OAuthAuthorizeActionsBase);
|
||||
|
||||
type OAuthAuthorizeInlineActionsProps = Omit<OAuthAuthorizeActionsProps, 'layout'>;
|
||||
|
||||
export const OAuthAuthorizeInlineActions: React.FC<OAuthAuthorizeInlineActionsProps> = observer((props) => (
|
||||
const OAuthAuthorizeInlineActions: React.FC<OAuthAuthorizeInlineActionsProps> = observer((props) => (
|
||||
<div className={styles.actions} data-flx={`${props.dataFlxPrefix}.actions`}>
|
||||
<OAuthAuthorizeActions
|
||||
data-flx="auth.oauth-authorize-page.o-auth-authorize-actions.o-auth-authorize-inline-actions.o-auth-authorize-actions"
|
||||
@@ -125,7 +125,7 @@ interface OAuthAuthorizeRedirectNoticeProps {
|
||||
hostnameDataFlx: string;
|
||||
}
|
||||
|
||||
export const OAuthAuthorizeRedirectNotice: React.FC<OAuthAuthorizeRedirectNoticeProps> = ({
|
||||
const OAuthAuthorizeRedirectNotice: React.FC<OAuthAuthorizeRedirectNoticeProps> = ({
|
||||
authParams,
|
||||
redirectHostname,
|
||||
dataFlx,
|
||||
|
||||
+1
-9
@@ -19,7 +19,7 @@ export interface AuthorizeParams {
|
||||
codeChallengeMethod: string | null;
|
||||
}
|
||||
|
||||
export interface PublicAppBot {
|
||||
interface PublicAppBot {
|
||||
id: string;
|
||||
avatar: string | null;
|
||||
username?: string | null;
|
||||
@@ -53,14 +53,6 @@ export interface GuildWithPermissions {
|
||||
threadsActive: boolean;
|
||||
}
|
||||
|
||||
export interface SignedInView {
|
||||
userId: string;
|
||||
displayName: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatarUrl: string | undefined;
|
||||
}
|
||||
|
||||
export function isSafeRedirectUri(uri: string): boolean {
|
||||
try {
|
||||
const u = new URL(uri);
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {http} from '@app/features/platform/transport/RestTransport';
|
||||
import {HttpError} from '@app/features/platform/types/EndpointError';
|
||||
import {useEffect, useState} from 'react';
|
||||
|
||||
export type PublicAppStatus = 'idle' | 'loading' | 'ready' | 'session_expired' | 'error';
|
||||
type PublicAppStatus = 'idle' | 'loading' | 'ready' | 'session_expired' | 'error';
|
||||
|
||||
export interface PublicAppState {
|
||||
status: PublicAppStatus;
|
||||
|
||||
+4
-4
@@ -22,9 +22,9 @@ interface AuthorizeMachineContext {
|
||||
destinationName: string | null;
|
||||
}
|
||||
|
||||
export const INITIAL_PHASE: AuthorizePhase = {kind: 'loading'};
|
||||
const INITIAL_PHASE: AuthorizePhase = {kind: 'loading'};
|
||||
|
||||
export const authorizeStateMachine = setup({
|
||||
const authorizeStateMachine = setup({
|
||||
types: {} as {
|
||||
context: AuthorizeMachineContext;
|
||||
events: AuthorizeEvent;
|
||||
@@ -77,7 +77,7 @@ export const authorizeStateMachine = setup({
|
||||
});
|
||||
|
||||
export type AuthorizeMachineSnapshot = SnapshotFrom<typeof authorizeStateMachine>;
|
||||
export type AuthorizeMachineStateValue = 'loading' | 'session_expired' | 'invalid_request' | 'review' | 'success';
|
||||
type AuthorizeMachineStateValue = 'loading' | 'session_expired' | 'invalid_request' | 'review' | 'success';
|
||||
|
||||
export function createAuthorizeSnapshot(): AuthorizeMachineSnapshot {
|
||||
return initialTransition(authorizeStateMachine)[0];
|
||||
@@ -90,7 +90,7 @@ export function transitionAuthorizeSnapshot(
|
||||
return transition(authorizeStateMachine, snapshot, event)[0] as AuthorizeMachineSnapshot;
|
||||
}
|
||||
|
||||
export function getAuthorizeStateValue(snapshot: AuthorizeMachineSnapshot): AuthorizeMachineStateValue {
|
||||
function getAuthorizeStateValue(snapshot: AuthorizeMachineSnapshot): AuthorizeMachineStateValue {
|
||||
switch (snapshot.value) {
|
||||
case 'session_expired':
|
||||
case 'invalid_request':
|
||||
|
||||
@@ -32,15 +32,3 @@ export function AuthBottomLink({variant, to}: AuthBottomLinkProps) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
interface AuthBottomLinksProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export function AuthBottomLinks({children}: AuthBottomLinksProps) {
|
||||
return (
|
||||
<div className={styles.bottomLinks} data-flx="auth.flow.auth-bottom-link.auth-bottom-links.bottom-links">
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type LoadableComponent,
|
||||
} from '@app/features/platform/components/loadable/LoadableComponent';
|
||||
|
||||
export type AuthRoutePageProps = Record<string, unknown>;
|
||||
type AuthRoutePageProps = Record<string, unknown>;
|
||||
export type AuthRoutePage = LoadableComponent<AuthRoutePageProps>;
|
||||
|
||||
export function createAuthRoutePage(displayName: string, load: () => Promise<{default: unknown}>): AuthRoutePage {
|
||||
|
||||
@@ -85,12 +85,6 @@
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.verifiedIcon {
|
||||
height: 1.5rem;
|
||||
width: 1.5rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.entityStats {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -185,25 +179,11 @@ img.entityIcon {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loginForm {
|
||||
margin-top: 2rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.bottomLink {
|
||||
margin-top: 1rem;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bottomLinks {
|
||||
margin-top: 1.25rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.bottomLinkText {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-tertiary);
|
||||
@@ -223,45 +203,6 @@ img.entityIcon {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin-top: 1.5rem;
|
||||
margin-bottom: 1.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.dividerLine {
|
||||
flex: 1 1 0%;
|
||||
border-top: 0.0625rem solid var(--background-modifier-accent);
|
||||
}
|
||||
|
||||
.dividerText {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.forgotPasswordLink {
|
||||
text-align: left;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.forgotPasswordLinkText {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-tertiary);
|
||||
transition-property: color;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.forgotPasswordLinkText:hover {
|
||||
color: var(--text-primary);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.usernameHint {
|
||||
margin-top: 0.25rem;
|
||||
display: block;
|
||||
@@ -316,10 +257,6 @@ img.entityIcon {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.submitSpacer {
|
||||
height: 0.25rem;
|
||||
}
|
||||
|
||||
.disabledContainer {
|
||||
margin-top: 1.5rem;
|
||||
display: flex;
|
||||
@@ -390,17 +327,3 @@ img.entityIcon {
|
||||
line-height: 1.5;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.secondaryInlineAction {
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: none;
|
||||
text-align: left;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-link);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.secondaryInlineAction:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
@@ -36,11 +36,6 @@ export function resolveAuthPanelSso(runtimeSnapshot: RuntimeConfigSnapshot): Ins
|
||||
return runtimeSnapshot.sso ?? null;
|
||||
}
|
||||
|
||||
export function isRuntimeSsoEnforced(): boolean {
|
||||
const ssoConfig = RuntimeConfig.sso;
|
||||
return isInstanceSsoAvailable(ssoConfig) && ssoConfig?.enforced === true;
|
||||
}
|
||||
|
||||
interface AuthSsoPanelProps {
|
||||
redirectPath?: string;
|
||||
extraTopContent?: ReactNode;
|
||||
|
||||
@@ -211,5 +211,3 @@ export function showBrowserLoginHandoffModal(
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
export default BrowserLoginHandoffModal;
|
||||
@@ -103,7 +103,7 @@ export const GuildInviteHeader = observer(function GuildInviteHeader({invite}: G
|
||||
</div>
|
||||
);
|
||||
});
|
||||
export const GroupDMInviteHeader = observer(function GroupDMInviteHeader({invite}: GroupDMInviteHeaderProps) {
|
||||
const GroupDMInviteHeader = observer(function GroupDMInviteHeader({invite}: GroupDMInviteHeaderProps) {
|
||||
const inviter = invite.inviter;
|
||||
const inviterDisplayName = inviter ? NicknameUtils.getDisplayName(inviter) : null;
|
||||
const avatarUrl = inviter ? AvatarUtils.getUserAvatarURL(inviter, false) : null;
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.retryingText {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-primary-muted);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
|
||||
@@ -22,7 +22,6 @@ import Authentication from '@app/features/auth/state/Authentication';
|
||||
import {
|
||||
authenticateMfaWithWebAuthn,
|
||||
authenticateWithWebAuthn,
|
||||
completeLoginSession,
|
||||
getWebAuthnAuthenticationOptions,
|
||||
getWebAuthnMfaOptions,
|
||||
type IpAuthorizationChallenge,
|
||||
@@ -98,31 +97,6 @@ function requireLoginRuntimeSnapshot(runtimeSnapshot: RuntimeConfigSnapshot | nu
|
||||
return runtimeSnapshot;
|
||||
}
|
||||
|
||||
export type LoginCompletionMode =
|
||||
| {
|
||||
type: 'redirect';
|
||||
path: string;
|
||||
}
|
||||
| {
|
||||
type: 'callback';
|
||||
onComplete: () => void | Promise<void>;
|
||||
};
|
||||
|
||||
export function useLoginCompletion(mode: LoginCompletionMode) {
|
||||
const modeRef = useRef(mode);
|
||||
modeRef.current = mode;
|
||||
const completeLogin = useCallback(async (payload: LoginSuccessPayload) => {
|
||||
await completeLoginSession(payload, RuntimeConfig.getSnapshot());
|
||||
const currentMode = modeRef.current;
|
||||
if (currentMode.type === 'redirect') {
|
||||
RouterUtils.replaceWith(currentMode.path);
|
||||
} else {
|
||||
await currentMode.onComplete();
|
||||
}
|
||||
}, []);
|
||||
return {completeLogin};
|
||||
}
|
||||
|
||||
type LegacyPasskeyLoginOutcome = LoginSuccessPayload | 'cancelled' | 'navigating';
|
||||
|
||||
async function runLegacyPasskeyLogin(mfa: MfaChallenge | null): Promise<LegacyPasskeyLoginOutcome> {
|
||||
|
||||
@@ -330,7 +330,7 @@ export async function resetPassword(
|
||||
};
|
||||
}
|
||||
|
||||
export interface IssuedRecoveryKit {
|
||||
interface IssuedRecoveryKit {
|
||||
recoveryKey: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
@@ -260,23 +260,6 @@ class NewDeviceMonitoring {
|
||||
}
|
||||
}
|
||||
|
||||
clearIgnoredDevices(): void {
|
||||
this.ignoredDeviceIds = [];
|
||||
logger.debug('Cleared all ignored devices');
|
||||
}
|
||||
|
||||
removeFromIgnored(deviceId: string): void {
|
||||
const index = this.ignoredDeviceIds.indexOf(deviceId);
|
||||
if (index !== -1) {
|
||||
this.ignoredDeviceIds.splice(index, 1);
|
||||
logger.debug('Removed device from ignore list', {deviceId});
|
||||
}
|
||||
}
|
||||
|
||||
getIgnoredDeviceIds(): ReadonlyArray<string> {
|
||||
return this.ignoredDeviceIds;
|
||||
}
|
||||
|
||||
setSuppressAlerts(suppress: boolean): void {
|
||||
this.suppressAlerts = suppress;
|
||||
logger.debug('Suppress alerts setting changed', {suppress});
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
type VoiceDeviceState,
|
||||
} from '@app/features/voice/utils/VoiceDeviceManager';
|
||||
|
||||
export type DeviceType = 'input' | 'output' | 'input_output';
|
||||
type DeviceType = 'input' | 'output' | 'input_output';
|
||||
|
||||
export interface PendingDevicePrompt {
|
||||
deviceIds: Array<string>;
|
||||
|
||||
@@ -54,7 +54,7 @@ export function isAbortError(error: unknown): boolean {
|
||||
|
||||
export const SUDO_MODAL_KEY = 'sudo-verification-modal';
|
||||
|
||||
export interface AvailableMethods {
|
||||
interface AvailableMethods {
|
||||
password: boolean;
|
||||
totp: boolean;
|
||||
webauthn: boolean;
|
||||
@@ -144,10 +144,6 @@ class SudoPrompt {
|
||||
});
|
||||
}
|
||||
|
||||
get hardMfaLock(): boolean {
|
||||
return this.availableMethods.hasMfa;
|
||||
}
|
||||
|
||||
requestVerification(context: SudoRequestContext = {method: 'POST', path: ''}): Promise<SudoVerificationPayload> {
|
||||
return new Promise((resolve, reject) => {
|
||||
runInAction(() => {
|
||||
|
||||
@@ -151,12 +151,6 @@ export const FLUXER_ACCOUNTS_V2_RECORD_CLASSES: ReadonlyArray<AccountRecordClass
|
||||
},
|
||||
];
|
||||
|
||||
export const FLUXER_ACCOUNTS_V2_GOLDEN_RECORDS: ReadonlyArray<StoredAccount> =
|
||||
FLUXER_ACCOUNTS_V2_RECORD_CLASSES.flatMap((recordClass) => recordClass.records);
|
||||
|
||||
export const FLUXER_ACCOUNTS_V2_EXPECTED_STORAGE_KEYS: ReadonlyArray<string> =
|
||||
FLUXER_ACCOUNTS_V2_RECORD_CLASSES.flatMap((recordClass) => recordClass.expectedStorageKeys);
|
||||
|
||||
const FLUXER_ACCOUNTS_DB_NAME = 'FluxerAccounts';
|
||||
export const FLUXER_ACCOUNTS_DB_VERSION = 2;
|
||||
export const FLUXER_ACCOUNTS_STORE_NAME = 'accounts';
|
||||
@@ -175,11 +169,3 @@ export function openGoldenAccountsDatabase(factory: IDBFactory): Promise<IDBData
|
||||
request.onerror = () => reject(request.error ?? new Error('IndexedDB open failed'));
|
||||
});
|
||||
}
|
||||
|
||||
export function deleteGoldenAccountsDatabase(factory: IDBFactory): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const request = factory.deleteDatabase(FLUXER_ACCOUNTS_DB_NAME);
|
||||
request.onsuccess = () => resolve();
|
||||
request.onerror = () => reject(request.error ?? new Error('IndexedDB deleteDatabase failed'));
|
||||
});
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
import type {PDFDocument, PDFFont, PDFPage, RGB} from 'pdf-lib';
|
||||
import QRCode from 'qrcode';
|
||||
|
||||
export interface RecoveryKitSheetDetail {
|
||||
interface RecoveryKitSheetDetail {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user