Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Refactor mobile unlock to mobile login naming, update migrations (#1347)

Leendert de Borst0db3e2dbf404
diff --git a/apps/browser-extension/src/entrypoints/popup/App.tsx b/apps/browser-extension/src/entrypoints/popup/App.tsx
index f747a0835..5ba47429d 100644
--- a/apps/browser-extension/src/entrypoints/popup/App.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/App.tsx
@@ -13,7 +13,7 @@ import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
import { NavigationProvider } from '@/entrypoints/popup/context/NavigationContext';
import AuthSettings from '@/entrypoints/popup/pages/auth/AuthSettings';
import Login from '@/entrypoints/popup/pages/auth/Login';
-import MobileUnlock from '@/entrypoints/popup/pages/auth/MobileUnlock';
+import MobileLogin from '@/entrypoints/popup/pages/auth/MobileLogin';
import Unlock from '@/entrypoints/popup/pages/auth/Unlock';
import UnlockSuccess from '@/entrypoints/popup/pages/auth/UnlockSuccess';
import Upgrade from '@/entrypoints/popup/pages/auth/Upgrade';
@@ -179,7 +179,7 @@ const App: React.FC = () => {
{ path: '/', element: <Index />, showBackButton: false },
{ path: '/reinitialize', element: <Reinitialize />, showBackButton: false },
{ path: '/login', element: <Login />, showBackButton: false, layout: LayoutType.AUTH },
- { path: '/mobile-unlock', element: <MobileUnlock />, showBackButton: false, layout: LayoutType.AUTH },
+ { path: '/mobile-login', element: <MobileLogin />, showBackButton: false, layout: LayoutType.AUTH },
{ path: '/unlock', element: <Unlock />, showBackButton: false, layout: LayoutType.AUTH },
{ path: '/unlock-success', element: <UnlockSuccess />, showBackButton: false },
{ path: '/upgrade', element: <Upgrade />, showBackButton: false },
diff --git a/apps/browser-extension/src/entrypoints/popup/context/NavigationContext.tsx b/apps/browser-extension/src/entrypoints/popup/context/NavigationContext.tsx
index 6a5e8aeca..bee764717 100644
--- a/apps/browser-extension/src/entrypoints/popup/context/NavigationContext.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/context/NavigationContext.tsx
@@ -48,7 +48,7 @@ export const NavigationProvider: React.FC<{ children: React.ReactNode }> = ({ ch
'/',
'/reinitialize',
'/login',
- '/mobile-unlock',
+ '/mobile-login',
'/unlock',
'/unlock-success',
'/auth-settings',
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
index 53ac86fe5..3606aa71a 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx
@@ -420,7 +420,7 @@ const Login: React.FC = () => {
<button
type="button"
- onClick={() => navigate('/mobile-unlock')}
+ onClick={() => navigate('/mobile-login')}
className="w-full px-4 py-2 text-sm font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-600 dark:text-white dark:border-gray-500 dark:hover:bg-gray-500 dark:focus:ring-gray-700 flex items-center justify-center gap-2"
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/MobileUnlock.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/MobileLogin.tsx
similarity index 86%
rename from apps/browser-extension/src/entrypoints/popup/pages/auth/MobileUnlock.tsx
rename to apps/browser-extension/src/entrypoints/popup/pages/auth/MobileLogin.tsx
index c75df2f09..618218eb7 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/MobileUnlock.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/MobileLogin.tsx
@@ -8,14 +8,14 @@ import { useAuth } from '@/entrypoints/popup/context/AuthContext';
import { useDb } from '@/entrypoints/popup/context/DbContext';
import { useLoading } from '@/entrypoints/popup/context/LoadingContext';
import { useWebApi } from '@/entrypoints/popup/context/WebApiContext';
-import { MobileUnlockUtility } from '@/entrypoints/popup/utils/MobileUnlockUtility';
+import { MobileLoginUtility } from '@/entrypoints/popup/utils/MobileLoginUtility';
import type { VaultResponse } from '@/utils/dist/shared/models/webapi';
/**
- * Mobile unlock page - scan QR code with mobile device to unlock.
+ * Mobile login page - scan QR code with mobile device to login.
*/
-const MobileUnlock: React.FC = () => {
+const MobileLogin: React.FC = () => {
const { t } = useTranslation();
const navigate = useNavigate();
const webApi = useWebApi();
@@ -26,7 +26,7 @@ const MobileUnlock: React.FC = () => {
const [qrCodeUrl, setQrCodeUrl] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
const [timeRemaining, setTimeRemaining] = useState<number>(120); // 2 minutes in seconds
- const mobileUnlockRef = useRef<MobileUnlockUtility | null>(null);
+ const mobileLoginRef = useRef<MobileLoginUtility | null>(null);
const countdownIntervalRef = useRef<NodeJS.Timeout | null>(null);
// Countdown timer effect
@@ -54,23 +54,23 @@ const MobileUnlock: React.FC = () => {
useEffect(() => {
/**
- * Initialize mobile unlock on component mount.
+ * Initialize mobile login on component mount.
*/
- const initiateMobileUnlock = async () : Promise<void> => {
+ const initiateMobileLogin = async () : Promise<void> => {
try {
showLoading();
setError(null);
- // Initialize mobile unlock utility
- if (!mobileUnlockRef.current) {
- mobileUnlockRef.current = new MobileUnlockUtility(webApi);
+ // Initialize mobile login utility
+ if (!mobileLoginRef.current) {
+ mobileLoginRef.current = new MobileLoginUtility(webApi);
}
- // Initiate mobile unlock and get QR code data
- const requestId = await mobileUnlockRef.current.initiate();
+ // Initiate mobile login and get QR code data
+ const requestId = await mobileLoginRef.current.initiate();
- // Generate QR code with AliasVault prefix for mobile unlock
- const qrData = `aliasvault://mobile-unlock/${requestId}`;
+ // Generate QR code with AliasVault prefix for mobile login
+ const qrData = `aliasvault://mobile-login/${requestId}`;
const qrDataUrl = await QRCode.toDataURL(qrData, {
width: 256,
margin: 2,
@@ -80,7 +80,7 @@ const MobileUnlock: React.FC = () => {
hideLoading();
// Start polling for response
- await mobileUnlockRef.current.startPolling(
+ await mobileLoginRef.current.startPolling(
async (username, token, refreshToken, decryptionKey, salt, encryptionType, encryptionSettings) => {
showLoading();
try {
@@ -121,12 +121,12 @@ const MobileUnlock: React.FC = () => {
}
};
- initiateMobileUnlock();
+ initiateMobileLogin();
// Cleanup on unmount
return (): void => {
- if (mobileUnlockRef.current) {
- mobileUnlockRef.current.cleanup();
+ if (mobileLoginRef.current) {
+ mobileLoginRef.current.cleanup();
}
if (countdownIntervalRef.current) {
clearInterval(countdownIntervalRef.current);
@@ -190,8 +190,8 @@ const MobileUnlock: React.FC = () => {
* Handle back button.
*/
const handleBack = () : void => {
- if (mobileUnlockRef.current) {
- mobileUnlockRef.current.cleanup();
+ if (mobileLoginRef.current) {
+ mobileLoginRef.current.cleanup();
}
if (countdownIntervalRef.current) {
clearInterval(countdownIntervalRef.current);
@@ -241,4 +241,4 @@ const MobileUnlock: React.FC = () => {
);
};
-export default MobileUnlock;
+export default MobileLogin;
diff --git a/apps/browser-extension/src/entrypoints/popup/utils/MobileUnlockUtility.ts b/apps/browser-extension/src/entrypoints/popup/utils/MobileLoginUtility.ts
similarity index 80%
rename from apps/browser-extension/src/entrypoints/popup/utils/MobileUnlockUtility.ts
rename to apps/browser-extension/src/entrypoints/popup/utils/MobileLoginUtility.ts
index b57d2a32e..828721d9a 100644
--- a/apps/browser-extension/src/entrypoints/popup/utils/MobileUnlockUtility.ts
+++ b/apps/browser-extension/src/entrypoints/popup/utils/MobileLoginUtility.ts
@@ -1,20 +1,20 @@
import { Buffer } from 'buffer';
-import type { MobileUnlockInitiateResponse, MobileUnlockPollResponse } from '@/utils/dist/shared/models/webapi';
+import type { MobileLoginInitiateResponse, MobileLoginPollResponse } from '@/utils/dist/shared/models/webapi';
import EncryptionUtility from '@/utils/EncryptionUtility';
import type { WebApiService } from '@/utils/WebApiService';
/**
- * Utility class for mobile unlock operations
+ * Utility class for mobile login operations
*/
-export class MobileUnlockUtility {
+export class MobileLoginUtility {
private webApi: WebApiService;
private pollingInterval: NodeJS.Timeout | null = null;
private requestId: string | null = null;
private privateKey: string | null = null;
/**
- * Constructor for the MobileUnlockUtility class.
+ * Constructor for the MobileLoginUtility class.
*
* @param {WebApiService} webApi - The WebApiService instance.
*/
@@ -23,7 +23,7 @@ export class MobileUnlockUtility {
}
/**
- * Initiates a mobile unlock request and returns the QR code data
+ * Initiates a mobile login request and returns the QR code data
*/
public async initiate(): Promise<string> {
// Generate RSA key pair
@@ -31,7 +31,7 @@ export class MobileUnlockUtility {
this.privateKey = keyPair.privateKey;
// Send public key to server (no auth required)
- const response = await this.webApi.rawFetch('auth/mobile-unlock/initiate', {
+ const response = await this.webApi.rawFetch('auth/mobile-login/initiate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -42,12 +42,12 @@ export class MobileUnlockUtility {
});
if (!response.ok) {
- const error = new Error(`Failed to initiate mobile unlock: ${response.status}`) as Error & { status: number };
+ const error = new Error(`Failed to initiate mobile login: ${response.status}`) as Error & { status: number };
error.status = response.status;
throw error;
}
- const data = await response.json() as MobileUnlockInitiateResponse;
+ const data = await response.json() as MobileLoginInitiateResponse;
this.requestId = data.requestId;
// Return QR code data (request ID)
@@ -55,7 +55,7 @@ export class MobileUnlockUtility {
}
/**
- * Starts polling the server for mobile unlock response
+ * Starts polling the server for mobile login response
*/
public async startPolling(
onSuccess: (username: string, token: string, refreshToken: string, decryptionKey: string, salt: string, encryptionType: string, encryptionSettings: string) => void,
@@ -66,7 +66,7 @@ export class MobileUnlockUtility {
}
/**
- * Polls the server for mobile unlock response
+ * Polls the server for mobile login response
*/
const pollFn = async (): Promise<void> => {
try {
@@ -76,7 +76,7 @@ export class MobileUnlockUtility {
}
const response = await this.webApi.rawFetch(
- `auth/mobile-unlock/poll/${this.requestId}`,
+ `auth/mobile-login/poll/${this.requestId}`,
{
method: 'GET',
}
@@ -88,13 +88,13 @@ export class MobileUnlockUtility {
this.stopPolling();
this.privateKey = null;
this.requestId = null;
- onError('Mobile unlock request expired');
+ onError('Mobile login request expired');
return;
}
throw new Error(`Polling failed: ${response.status}`);
}
- const data = await response.json() as MobileUnlockPollResponse;
+ const data = await response.json() as MobileLoginPollResponse;
if (data.fulfilled && data.encryptedDecryptionKey && data.username && data.token && data.salt && data.encryptionType && data.encryptionSettings) {
// Stop polling
@@ -141,7 +141,7 @@ export class MobileUnlockUtility {
this.stopPolling();
this.privateKey = null;
this.requestId = null;
- onError('Mobile unlock request timed out');
+ onError('Mobile login request timed out');
}
}, 120000);
}
diff --git a/apps/browser-extension/src/utils/dist/shared/models/webapi/index.d.ts b/apps/browser-extension/src/utils/dist/shared/models/webapi/index.d.ts
index 8757ef03f..c593bb513 100644
--- a/apps/browser-extension/src/utils/dist/shared/models/webapi/index.d.ts
+++ b/apps/browser-extension/src/utils/dist/shared/models/webapi/index.d.ts
@@ -385,29 +385,29 @@ declare enum AuthEventType {
}
/**
- * Mobile unlock initiate request type.
+ * Mobile login initiate request type.
*/
-type MobileUnlockInitiateRequest = {
+type MobileLoginInitiateRequest = {
clientPublicKey: string;
};
/**
- * Mobile unlock initiate response type.
+ * Mobile login initiate response type.
*/
-type MobileUnlockInitiateResponse = {
+type MobileLoginInitiateResponse = {
requestId: string;
};
/**
- * Mobile unlock submit request type.
+ * Mobile login submit request type.
*/
-type MobileUnlockSubmitRequest = {
+type MobileLoginSubmitRequest = {
requestId: string;
encryptedDecryptionKey: string;
username: string;
};
/**
- * Mobile unlock poll response type.
+ * Mobile login poll response type.
*/
-type MobileUnlockPollResponse = {
+type MobileLoginPollResponse = {
fulfilled: boolean;
encryptedDecryptionKey: string | null;
username: string | null;
@@ -417,4 +417,4 @@ type MobileUnlockPollResponse = {
encryptionSettings: string | null;
};
-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type FaviconExtractModel, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type MobileUnlockInitiateRequest, type MobileUnlockInitiateResponse, type MobileUnlockPollResponse, type MobileUnlockSubmitRequest, type PasswordChangeInitiateResponse, type RefreshToken, type StatusResponse, type TokenModel, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse };
+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type FaviconExtractModel, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type RefreshToken, type StatusResponse, type TokenModel, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse };
diff --git a/apps/mobile-app/app/(tabs)/settings/_layout.tsx b/apps/mobile-app/app/(tabs)/settings/_layout.tsx
index f21665ff5..535e74441 100644
--- a/apps/mobile-app/app/(tabs)/settings/_layout.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/_layout.tsx
@@ -136,7 +136,7 @@ export default function SettingsLayout(): React.ReactNode {
<Stack.Screen
name="qr-confirm"
options={{
- title: t('settings.qrScanner.mobileUnlock.confirmTitle'),
+ title: t('settings.qrScanner.mobileLogin.confirmTitle'),
...defaultHeaderOptions,
}}
/>
diff --git a/apps/mobile-app/app/(tabs)/settings/qr-confirm.tsx b/apps/mobile-app/app/(tabs)/settings/qr-confirm.tsx
index 31b4de6d3..58dab7547 100644
--- a/apps/mobile-app/app/(tabs)/settings/qr-confirm.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/qr-confirm.tsx
@@ -17,7 +17,7 @@ import { useWebApi } from '@/context/WebApiContext';
import NativeVaultManager from '@/specs/NativeVaultManager';
/**
- * QR Code confirmation screen for mobile unlock.
+ * QR Code confirmation screen for mobile login.
*/
export default function QRConfirmScreen() : React.ReactNode {
const colors = useColors();
@@ -30,24 +30,24 @@ export default function QRConfirmScreen() : React.ReactNode {
const [isProcessing, setIsProcessing] = useState(false);
/**
- * Handle mobile unlock QR code.
+ * Handle mobile login QR code.
*/
- const handleMobileUnlock = async (requestId: string) : Promise<void> => {
+ const handleMobileLogin = async (requestId: string) : Promise<void> => {
try {
// Fetch the public key from server
const response = await webApi.authFetch<{ clientPublicKey: string }>(
- `auth/mobile-unlock/request/${requestId}`,
+ `auth/mobile-login/request/${requestId}`,
{ method: 'GET' }
);
const publicKeyJWK = response.clientPublicKey;
// Encrypt the decryption key using native module
- const encryptedKey = await NativeVaultManager.encryptDecryptionKeyForMobileUnlock(publicKeyJWK);
+ const encryptedKey = await NativeVaultManager.encryptDecryptionKeyForMobileLogin(publicKeyJWK);
// Submit the encrypted key to the server
await webApi.authFetch(
- 'auth/mobile-unlock/submit',
+ 'auth/mobile-login/submit',
{
method: 'POST',
headers: {
@@ -66,11 +66,11 @@ export default function QRConfirmScreen() : React.ReactNode {
pathname: '/(tabs)/settings/qr-result',
params: {
success: 'true',
- message: t('settings.qrScanner.mobileUnlock.successDescription'),
+ message: t('settings.qrScanner.mobileLogin.successDescription'),
},
});
} catch (error) {
- console.error('Mobile unlock error:', error);
+ console.error('Mobile login error:', error);
let errorMsg = t('common.errors.unknownErrorTryAgain');
// Error! Navigate to result page
@@ -126,7 +126,7 @@ export default function QRConfirmScreen() : React.ReactNode {
if (!isBiometricEnabled && !isPinEnabled) {
Alert.alert(
t('common.error'),
- t('settings.qrScanner.mobileUnlock.noAuthMethodEnabled'),
+ t('settings.qrScanner.mobileLogin.noAuthMethodEnabled'),
[
{
text: t('common.ok'),
@@ -142,8 +142,8 @@ export default function QRConfirmScreen() : React.ReactNode {
// Authenticate user with either biometric or PIN (automatically detected)
const authenticated = await NativeVaultManager.authenticateUser(
- t('settings.qrScanner.mobileUnlock.confirmTitle'),
- t('settings.qrScanner.mobileUnlock.confirmSubtitle')
+ t('settings.qrScanner.mobileLogin.confirmTitle'),
+ t('settings.qrScanner.mobileLogin.confirmSubtitle')
);
if (!authenticated) {
@@ -151,8 +151,8 @@ export default function QRConfirmScreen() : React.ReactNode {
return;
}
- // Process the mobile unlock
- await handleMobileUnlock(requestId);
+ // Process the mobile login
+ await handleMobileLogin(requestId);
} catch (error) {
console.error('Authentication or QR code processing error:', error);
Alert.alert(
@@ -225,10 +225,10 @@ export default function QRConfirmScreen() : React.ReactNode {
<ThemedScrollView contentContainerStyle={{ flexGrow: 1 }}>
<View style={styles.confirmationContainer}>
<ThemedText style={styles.confirmationTitle}>
- {t('settings.qrScanner.mobileUnlock.confirmTitle')}
+ {t('settings.qrScanner.mobileLogin.confirmTitle')}
</ThemedText>
<ThemedText style={styles.confirmationText}>
- {t('settings.qrScanner.mobileUnlock.confirmMessage')}
+ {t('settings.qrScanner.mobileLogin.confirmMessage')}
</ThemedText>
<View style={styles.usernameDisplayContainer}>
<UsernameDisplay />
diff --git a/apps/mobile-app/app/(tabs)/settings/qr-result.tsx b/apps/mobile-app/app/(tabs)/settings/qr-result.tsx
index 4b4c14785..ad3219502 100644
--- a/apps/mobile-app/app/(tabs)/settings/qr-result.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/qr-result.tsx
@@ -93,7 +93,7 @@ export default function QRResultScreen() : React.ReactNode {
</ThemedText>
<ThemedText style={styles.message}>
{message || (isSuccess
- ? t('settings.qrScanner.mobileUnlock.successDescription')
+ ? t('settings.qrScanner.mobileLogin.successDescription')
: t('common.errors.unknownErrorTryAgain'))}
</ThemedText>
</View>
diff --git a/apps/mobile-app/app/(tabs)/settings/qr-scanner.tsx b/apps/mobile-app/app/(tabs)/settings/qr-scanner.tsx
index 2d08de66c..ce46a69d3 100644
--- a/apps/mobile-app/app/(tabs)/settings/qr-scanner.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/qr-scanner.tsx
@@ -15,7 +15,7 @@ import { useWebApi } from '@/context/WebApiContext';
// QR Code type prefixes
const QR_CODE_PREFIXES = {
- MOBILE_UNLOCK: 'aliasvault://mobile-unlock/',
+ MOBILE_LOGIN: 'aliasvault://mobile-login/',
/*
* Future: PASSKEY: 'aliasvault://passkey/',
* Future: SHARE_CREDENTIAL: 'aliasvault://share/',
@@ -96,10 +96,10 @@ export default function QRScannerScreen() : React.ReactNode {
setIsLoadingAfterScan(true);
try {
- if (parsedData.type === 'MOBILE_UNLOCK') {
+ if (parsedData.type === 'MOBILE_LOGIN') {
// Fetch the public key from server to validate the request exists
await webApi.authFetch<{ clientPublicKey: string }>(
- `auth/mobile-unlock/request/${parsedData.payload}`,
+ `auth/mobile-login/request/${parsedData.payload}`,
{ method: 'GET' }
);
@@ -122,7 +122,7 @@ export default function QRScannerScreen() : React.ReactNode {
if (error instanceof Error) {
if (error.message.includes('404')) {
- errorMsg = t('settings.qrScanner.mobileUnlock.requestExpired');
+ errorMsg = t('settings.qrScanner.mobileLogin.requestExpired');
} else {
errorMsg = t('common.errors.unknownErrorTryAgain');
}
diff --git a/apps/mobile-app/app/_layout.tsx b/apps/mobile-app/app/_layout.tsx
index 17b23fe9f..e90b4d5e3 100644
--- a/apps/mobile-app/app/_layout.tsx
+++ b/apps/mobile-app/app/_layout.tsx
@@ -69,8 +69,8 @@ function RootLayoutNav() : React.ReactNode {
.replace('aliasvault://', '')
.replace('exp+aliasvault://', '');
- // Handle mobile unlock QR code scans from native camera
- if (path.startsWith('mobile-unlock/')) {
+ // Handle mobile login QR code scans from native camera
+ if (path.startsWith('mobile-login/')) {
// Process the QR code
router.push(`/(tabs)/settings/qr-scanner?url=${encodeURIComponent(`aliasvault://${path}`)}` as Href);
return;
diff --git a/apps/mobile-app/i18n/locales/en.json b/apps/mobile-app/i18n/locales/en.json
index 6d3cda288..39dbdf15a 100644
--- a/apps/mobile-app/i18n/locales/en.json
+++ b/apps/mobile-app/i18n/locales/en.json
@@ -404,7 +404,7 @@
"notAliasVaultQr": "This is not a valid AliasVault QR code. Please scan a QR code generated by AliasVault.",
"cameraPermissionTitle": "Camera Permission Required",
"cameraPermissionMessage": "Please allow camera access to scan QR codes.",
- "mobileUnlock": {
+ "mobileLogin": {
"confirmTitle": "Confirm Login Request",
"confirmSubtitle": "Re-authenticate to approve login on another device.",
"confirmMessage": "You are about to log in on a remote device with your account. This other device will have full access to your vault. Only proceed if you trust this device.",
diff --git a/apps/mobile-app/ios/NativeVaultManager/RCTNativeVaultManager.mm b/apps/mobile-app/ios/NativeVaultManager/RCTNativeVaultManager.mm
index 160c18413..5abc17116 100644
--- a/apps/mobile-app/ios/NativeVaultManager/RCTNativeVaultManager.mm
+++ b/apps/mobile-app/ios/NativeVaultManager/RCTNativeVaultManager.mm
@@ -279,10 +279,10 @@
[vaultManager showPinSetup:resolve rejecter:reject];
}
-// MARK: - Mobile Unlock
+// MARK: - Mobile Login
-- (void)encryptDecryptionKeyForMobileUnlock:(NSString *)publicKeyJWK resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
- [vaultManager encryptDecryptionKeyForMobileUnlock:publicKeyJWK resolver:resolve rejecter:reject];
+- (void)encryptDecryptionKeyForMobileLogin:(NSString *)publicKeyJWK resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
+ [vaultManager encryptDecryptionKeyForMobileLogin:publicKeyJWK resolver:resolve rejecter:reject];
}
// MARK: - Re-authentication
diff --git a/apps/mobile-app/ios/NativeVaultManager/VaultManager.swift b/apps/mobile-app/ios/NativeVaultManager/VaultManager.swift
index 4d0bc3191..621963e3a 100644
--- a/apps/mobile-app/ios/NativeVaultManager/VaultManager.swift
+++ b/apps/mobile-app/ios/NativeVaultManager/VaultManager.swift
@@ -898,12 +898,12 @@ public class VaultManager: NSObject {
}
@objc
- func encryptDecryptionKeyForMobileUnlock(_ publicKeyJWK: String,
- resolver resolve: @escaping RCTPromiseResolveBlock,
- rejecter reject: @escaping RCTPromiseRejectBlock) {
+ func encryptDecryptionKeyForMobileLogin(_ publicKeyJWK: String,
+ resolver resolve: @escaping RCTPromiseResolveBlock,
+ rejecter reject: @escaping RCTPromiseRejectBlock) {
do {
// Get the encryption key and encrypt it with the provided public key
- let encryptedData = try vaultStore.encryptDecryptionKeyForMobileUnlock(publicKeyJWK: publicKeyJWK)
+ let encryptedData = try vaultStore.encryptDecryptionKeyForMobileLogin(publicKeyJWK: publicKeyJWK)
// Return the encrypted data as base64 string
let base64Encrypted = encryptedData.base64EncodedString()
diff --git a/apps/mobile-app/ios/VaultStoreKit/VaultStore+PublicKeyCrypto.swift b/apps/mobile-app/ios/VaultStoreKit/VaultStore+PublicKeyCrypto.swift
index f1a253700..04823cbda 100644
--- a/apps/mobile-app/ios/VaultStoreKit/VaultStore+PublicKeyCrypto.swift
+++ b/apps/mobile-app/ios/VaultStoreKit/VaultStore+PublicKeyCrypto.swift
@@ -3,11 +3,11 @@ import Security
/// Extension for the VaultStore class to handle RSA public key encryption
extension VaultStore {
- /// Encrypts the vault's encryption key using an RSA public key for mobile unlock
+ /// Encrypts the vault's encryption key using an RSA public key for mobile login
/// This method gets the internal encryption key and encrypts it with the provided public key
/// - Parameter publicKeyJWK: The RSA public key in JWK format (JSON string)
/// - Returns: The encrypted encryption key
- public func encryptDecryptionKeyForMobileUnlock(publicKeyJWK: String) throws -> Data {
+ public func encryptDecryptionKeyForMobileLogin(publicKeyJWK: String) throws -> Data {
// Get the current encryption key from the vault store
// This will only work if the vault is unlocked (encryption key is in memory)
let encryptionKey = try getEncryptionKey()
diff --git a/apps/mobile-app/specs/NativeVaultManager.ts b/apps/mobile-app/specs/NativeVaultManager.ts
index 3212f0379..bec75b1ee 100644
--- a/apps/mobile-app/specs/NativeVaultManager.ts
+++ b/apps/mobile-app/specs/NativeVaultManager.ts
@@ -99,8 +99,8 @@ export interface Spec extends TurboModule {
showPinUnlock(): Promise<void>;
showPinSetup(): Promise<void>;
- // Mobile unlock methods
- encryptDecryptionKeyForMobileUnlock(publicKeyJWK: string): Promise<string>;
+ // Mobile login methods
+ encryptDecryptionKeyForMobileLogin(publicKeyJWK: string): Promise<string>;
// Re-authentication methods
// Authenticate user with biometric or PIN. If title/subtitle are null/empty, defaults to "Unlock Vault" context.
diff --git a/apps/mobile-app/utils/dist/shared/models/webapi/index.d.ts b/apps/mobile-app/utils/dist/shared/models/webapi/index.d.ts
index 8757ef03f..c593bb513 100644
--- a/apps/mobile-app/utils/dist/shared/models/webapi/index.d.ts
+++ b/apps/mobile-app/utils/dist/shared/models/webapi/index.d.ts
@@ -385,29 +385,29 @@ declare enum AuthEventType {
}
/**
- * Mobile unlock initiate request type.
+ * Mobile login initiate request type.
*/
-type MobileUnlockInitiateRequest = {
+type MobileLoginInitiateRequest = {
clientPublicKey: string;
};
/**
- * Mobile unlock initiate response type.
+ * Mobile login initiate response type.
*/
-type MobileUnlockInitiateResponse = {
+type MobileLoginInitiateResponse = {
requestId: string;
};
/**
- * Mobile unlock submit request type.
+ * Mobile login submit request type.
*/
-type MobileUnlockSubmitRequest = {
+type MobileLoginSubmitRequest = {
requestId: string;
encryptedDecryptionKey: string;
username: string;
};
/**
- * Mobile unlock poll response type.
+ * Mobile login poll response type.
*/
-type MobileUnlockPollResponse = {
+type MobileLoginPollResponse = {
fulfilled: boolean;
encryptedDecryptionKey: string | null;
username: string | null;
@@ -417,4 +417,4 @@ type MobileUnlockPollResponse = {
encryptionSettings: string | null;
};
-export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type FaviconExtractModel, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type MobileUnlockInitiateRequest, type MobileUnlockInitiateResponse, type MobileUnlockPollResponse, type MobileUnlockSubmitRequest, type PasswordChangeInitiateResponse, type RefreshToken, type StatusResponse, type TokenModel, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse };
+export { type ApiErrorResponse, AuthEventType, type AuthLogModel, type BadRequestResponse, type DeleteAccountInitiateRequest, type DeleteAccountInitiateResponse, type DeleteAccountRequest, type Email, type EmailAttachment, type FaviconExtractModel, type LoginRequest, type LoginResponse, type MailboxBulkRequest, type MailboxBulkResponse, type MailboxEmail, type MobileLoginInitiateRequest, type MobileLoginInitiateResponse, type MobileLoginPollResponse, type MobileLoginSubmitRequest, type PasswordChangeInitiateResponse, type RefreshToken, type StatusResponse, type TokenModel, type ValidateLoginRequest, type ValidateLoginRequest2Fa, type ValidateLoginResponse, type Vault, type VaultPasswordChangeRequest, type VaultPostResponse, type VaultResponse };
diff --git a/apps/server/AliasVault.Api/Controllers/AuthController.cs b/apps/server/AliasVault.Api/Controllers/AuthController.cs
index fa19974f4..600a2c8d0 100644
--- a/apps/server/AliasVault.Api/Controllers/AuthController.cs
+++ b/apps/server/AliasVault.Api/Controllers/AuthController.cs
@@ -50,10 +50,10 @@ using SecureRemotePassword;
public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserManager<AliasVaultUser> userManager, SignInManager<AliasVaultUser> signInManager, IConfiguration configuration, IMemoryCache cache, ITimeProvider timeProvider, AuthLoggingService authLoggingService, Config config, ServerSettingsService settingsService) : ControllerBase
{
/// <summary>
- /// Timeout in minutes for mobile unlock requests.
+ /// Timeout in minutes for mobile login requests.
/// Requests older than this will be automatically expired and removed.
/// </summary>
- private const int MobileUnlockTimeoutMinutes = 2;
+ private const int MobileLoginTimeoutMinutes = 2;
/// <summary>
/// Semaphore to prevent concurrent access to the database when generating new tokens for a user.
@@ -540,73 +540,72 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
}
/// <summary>
- /// Initiates a mobile unlock request by creating a QR code challenge.
+ /// Initiates a mobile login request by creating a QR code challenge.
/// </summary>
- /// <param name="model">The mobile unlock initiate request model.</param>
+ /// <param name="model">The mobile login initiate request model.</param>
/// <returns>IActionResult.</returns>
- [HttpPost("mobile-unlock/initiate")]
+ [HttpPost("mobile-login/initiate")]
[AllowAnonymous]
- public async Task<IActionResult> InitiateMobileUnlock([FromBody] MobileUnlockInitiateRequest model)
+ public async Task<IActionResult> InitiateMobileLogin([FromBody] MobileLoginInitiateRequest model)
{
await using var context = await dbContextFactory.CreateDbContextAsync();
// Generate a unique request ID
var requestId = Guid.NewGuid().ToString("N");
- // Create the unlock request
- var unlockRequest = new MobileUnlockRequest
+ // Create the login request
+ var loginRequest = new MobileLoginRequest
{
Id = requestId,
ClientPublicKey = model.ClientPublicKey,
- Fulfilled = false,
CreatedAt = timeProvider.UtcNow,
ClientIpAddress = IpAddressUtility.GetIpFromContext(HttpContext),
};
- context.MobileUnlockRequests.Add(unlockRequest);
+ context.MobileLoginRequests.Add(loginRequest);
await context.SaveChangesAsync();
- return Ok(new MobileUnlockInitiateResponse(requestId));
+ return Ok(new MobileLoginInitiateResponse(requestId));
}
/// <summary>
- /// Polls the status of a mobile unlock request.
+ /// Polls the status of a mobile login request.
/// </summary>
- /// <param name="requestId">The unique identifier for the unlock request.</param>
+ /// <param name="requestId">The unique identifier for the login request.</param>
/// <returns>IActionResult.</returns>
- [HttpGet("mobile-unlock/poll/{requestId}")]
+ [HttpGet("mobile-login/poll/{requestId}")]
[AllowAnonymous]
- public async Task<IActionResult> PollMobileUnlock(string requestId)
+ public async Task<IActionResult> PollMobileLogin(string requestId)
{
await using var context = await dbContextFactory.CreateDbContextAsync();
- var unlockRequest = await context.MobileUnlockRequests.FirstOrDefaultAsync(r => r.Id == requestId);
+ var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == requestId);
// Check if request exists and hasn't expired
- if (unlockRequest == null || unlockRequest.CreatedAt.AddMinutes(MobileUnlockTimeoutMinutes) < timeProvider.UtcNow)
+ if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
{
// Clean up expired request if it exists
- if (unlockRequest != null)
+ if (loginRequest != null)
{
- context.MobileUnlockRequests.Remove(unlockRequest);
+ context.MobileLoginRequests.Remove(loginRequest);
await context.SaveChangesAsync();
}
- return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_UNLOCK_REQUEST_NOT_FOUND, 404));
+ return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
}
// If not fulfilled, return pending status
- if (!unlockRequest.Fulfilled)
+ if (loginRequest.FulfilledAt == null)
{
- return Ok(new MobileUnlockPollResponse(false, null, null, null, null, null, null));
+ return Ok(new MobileLoginPollResponse(false, null, null, null, null, null, null));
}
// Request is fulfilled - get user and generate token
- var user = await userManager.FindByNameAsync(unlockRequest.Username!);
+ var user = await userManager.FindByNameAsync(loginRequest.Username!);
if (user == null)
{
// Clean up the request
- context.MobileUnlockRequests.Remove(unlockRequest);
+ context.MobileLoginRequests.Remove(loginRequest);
await context.SaveChangesAsync();
return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USER_NOT_FOUND, 400));
}
@@ -614,7 +613,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
// Check if the account is blocked.
if (user.Blocked)
{
- context.MobileUnlockRequests.Remove(unlockRequest);
+ context.MobileLoginRequests.Remove(loginRequest);
await context.SaveChangesAsync();
await authLoggingService.LogAuthEventFailAsync(user.UserName!, AuthEventType.Login, AuthFailureReason.AccountBlocked);
return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.ACCOUNT_BLOCKED, 400));
@@ -623,7 +622,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
// Check if the account is locked out.
if (await userManager.IsLockedOutAsync(user))
{
- context.MobileUnlockRequests.Remove(unlockRequest);
+ context.MobileLoginRequests.Remove(loginRequest);
await context.SaveChangesAsync();
await authLoggingService.LogAuthEventFailAsync(user.UserName!, AuthEventType.Login, AuthFailureReason.AccountLocked);
return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.ACCOUNT_LOCKED, 400));
@@ -639,58 +638,58 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
await userManager.ResetAccessFailedCountAsync(user);
// Return fulfilled response with encrypted key and token
- var response = new MobileUnlockPollResponse(
+ var response = new MobileLoginPollResponse(
true,
- unlockRequest.EncryptedDecryptionKey,
- unlockRequest.Username,
+ loginRequest.EncryptedDecryptionKey,
+ loginRequest.Username,
tokenModel,
- unlockRequest.Salt,
- unlockRequest.EncryptionType,
- unlockRequest.EncryptionSettings);
+ loginRequest.Salt,
+ loginRequest.EncryptionType,
+ loginRequest.EncryptionSettings);
// Clear sensitive data but keep the record for statistics
- unlockRequest.ClientPublicKey = string.Empty;
- unlockRequest.EncryptedDecryptionKey = null;
- unlockRequest.Salt = null;
- unlockRequest.EncryptionType = null;
- unlockRequest.EncryptionSettings = null;
- unlockRequest.RetrievedAt = timeProvider.UtcNow;
+ loginRequest.ClientPublicKey = string.Empty;
+ loginRequest.EncryptedDecryptionKey = null;
+ loginRequest.Salt = null;
+ loginRequest.EncryptionType = null;
+ loginRequest.EncryptionSettings = null;
+ loginRequest.RetrievedAt = timeProvider.UtcNow;
await context.SaveChangesAsync();
return Ok(response);
}
/// <summary>
- /// Gets the public key for a mobile unlock request (for mobile app to encrypt).
+ /// Gets the public key for a mobile login request (for mobile app to encrypt).
/// </summary>
- /// <param name="requestId">The unique identifier for the unlock request.</param>
+ /// <param name="requestId">The unique identifier for the login request.</param>
/// <returns>IActionResult.</returns>
- [HttpGet("mobile-unlock/request/{requestId}")]
+ [HttpGet("mobile-login/request/{requestId}")]
[Authorize]
- public async Task<IActionResult> GetMobileUnlockRequest(string requestId)
+ public async Task<IActionResult> GetMobileLoginRequest(string requestId)
{
await using var context = await dbContextFactory.CreateDbContextAsync();
- var unlockRequest = await context.MobileUnlockRequests.FirstOrDefaultAsync(r => r.Id == requestId);
+ var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == requestId);
// Check if request exists and hasn't expired
- if (unlockRequest == null || unlockRequest.CreatedAt.AddMinutes(MobileUnlockTimeoutMinutes) < timeProvider.UtcNow)
+ if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
{
- return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_UNLOCK_REQUEST_NOT_FOUND, 404));
+ return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
}
// Return only the public key
- return Ok(new { clientPublicKey = unlockRequest.ClientPublicKey });
+ return Ok(new { clientPublicKey = loginRequest.ClientPublicKey });
}
/// <summary>
- /// Submits a mobile unlock response from the mobile app.
+ /// Submits a mobile login response from the mobile app.
/// </summary>
- /// <param name="model">The mobile unlock submit request model.</param>
+ /// <param name="model">The mobile login submit request model.</param>
/// <returns>IActionResult.</returns>
- [HttpPost("mobile-unlock/submit")]
+ [HttpPost("mobile-login/submit")]
[Authorize]
- public async Task<IActionResult> SubmitMobileUnlock([FromBody] MobileUnlockSubmitRequest model)
+ public async Task<IActionResult> SubmitMobileLogin([FromBody] MobileLoginSubmitRequest model)
{
await using var context = await dbContextFactory.CreateDbContextAsync();
@@ -707,39 +706,39 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.USERNAME_MISMATCH, 400));
}
- var unlockRequest = await context.MobileUnlockRequests.FirstOrDefaultAsync(r => r.Id == model.RequestId);
+ var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == model.RequestId);
// Check if request exists and hasn't expired
- if (unlockRequest == null || unlockRequest.CreatedAt.AddMinutes(MobileUnlockTimeoutMinutes) < timeProvider.UtcNow)
+ if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
{
// Clean up expired request if it exists
- if (unlockRequest != null)
+ if (loginRequest != null)
{
- context.MobileUnlockRequests.Remove(unlockRequest);
+ context.MobileLoginRequests.Remove(loginRequest);
await context.SaveChangesAsync();
}
- return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_UNLOCK_REQUEST_NOT_FOUND, 404));
+ return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
}
// Check if already fulfilled
- if (unlockRequest.Fulfilled)
+ if (loginRequest.FulfilledAt != null)
{
- return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_UNLOCK_REQUEST_ALREADY_FULFILLED, 400));
+ return BadRequest(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_ALREADY_FULFILLED, 400));
}
// Get latest vault encryption settings for the user
var latestVaultEncryptionSettings = AuthHelper.GetUserLatestVaultEncryptionSettings(user);
- // Update the unlock request with the encrypted key and user info
- unlockRequest.EncryptedDecryptionKey = model.EncryptedDecryptionKey;
- unlockRequest.Username = model.Username;
- unlockRequest.Salt = latestVaultEncryptionSettings.Salt;
- unlockRequest.EncryptionType = latestVaultEncryptionSettings.EncryptionType;
- unlockRequest.EncryptionSettings = latestVaultEncryptionSettings.EncryptionSettings;
- unlockRequest.Fulfilled = true;
- unlockRequest.FulfilledAt = timeProvider.UtcNow;
- unlockRequest.MobileIpAddress = IpAddressUtility.GetIpFromContext(HttpContext);
+ // Update the login request with the encrypted key and user info
+ loginRequest.EncryptedDecryptionKey = model.EncryptedDecryptionKey;
+ loginRequest.Username = model.Username;
+ loginRequest.Salt = latestVaultEncryptionSettings.Salt;
+ loginRequest.EncryptionType = latestVaultEncryptionSettings.EncryptionType;
+ loginRequest.EncryptionSettings = latestVaultEncryptionSettings.EncryptionSettings;
+ loginRequest.UserId = user.Id;
+ loginRequest.FulfilledAt = timeProvider.UtcNow;
+ loginRequest.MobileIpAddress = IpAddressUtility.GetIpFromContext(HttpContext);
await context.SaveChangesAsync();
diff --git a/apps/server/AliasVault.Client/Auth/Pages/Login.razor b/apps/server/AliasVault.Client/Auth/Pages/Login.razor
index d3f84a98b..f4ea0f380 100644
--- a/apps/server/AliasVault.Client/Auth/Pages/Login.razor
+++ b/apps/server/AliasVault.Client/Auth/Pages/Login.razor
@@ -112,7 +112,7 @@ else
<a href="/user/forgot-password" class="ml-auto text-sm text-primary-700 hover:underline dark:text-primary-500">@Localizer["LostPasswordLink"]</a>
</div>
- <button type="submit" class="w-full px-5 py-3 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
+ <button type="submit" class="w-full px-5 py-2 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
@Localizer["LoginButton"]
</button>
@@ -125,7 +125,7 @@ else
</div>
</div>
- <a href="/user/mobile-unlock" class="hidden md:flex w-full px-5 py-3 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2">
+ <a href="/user/mobile-login" class="hidden md:flex w-full px-5 py-2 text-base font-medium text-center text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:ring-gray-700 items-center justify-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"></path>
</svg>
diff --git a/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor b/apps/server/AliasVault.Client/Auth/Pages/MobileLogin.razor
similarity index 85%
rename from apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor
rename to apps/server/AliasVault.Client/Auth/Pages/MobileLogin.razor
index 22bd8befa..848089c35 100644
--- a/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor
+++ b/apps/server/AliasVault.Client/Auth/Pages/MobileLogin.razor
@@ -1,4 +1,4 @@
-@page "/user/mobile-unlock"
+@page "/user/mobile-login"
@inherits AliasVault.Client.Auth.Pages.Base.LoginBase
@layout Auth.Layout.MainLayout
@attribute [AllowAnonymous]
@@ -34,7 +34,7 @@
@if (!string.IsNullOrEmpty(_qrCodeUrl))
{
- <div id="mobile-unlock-qr" data-url="@_qrCodeUrl" class="@(_isLoading ? "hidden" : "") mb-4 p-4 bg-white rounded-lg border-4 border-gray-200 dark:border-gray-600">
+ <div id="mobile-login-qr" data-url="@_qrCodeUrl" class="@(_isLoading ? "hidden" : "") mb-4 p-4 bg-white rounded-lg border-4 border-gray-200 dark:border-gray-600">
<!-- QR code will be rendered here -->
</div>
@if (!_isLoading)
@@ -59,11 +59,11 @@
private string? _qrCodeUrl;
private string? _errorMessage;
private int _timeRemaining = 120; // 2 minutes in seconds
- private MobileUnlockUtility? _mobileUnlockUtility;
+ private MobileLoginUtility? _mobileLoginUtility;
private bool _isLoading = true;
private System.Threading.Timer? _countdownTimer;
- private IStringLocalizer Localizer => LocalizerFactory.Create("Pages.Auth.MobileUnlock", "AliasVault.Client");
+ private IStringLocalizer Localizer => LocalizerFactory.Create("Pages.Auth.MobileLogin", "AliasVault.Client");
private IStringLocalizer ApiErrorLocalizer => LocalizerFactory.Create("ApiErrors", "AliasVault.Client");
private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
@@ -88,14 +88,14 @@
if (firstRender)
{
- await InitiateMobileUnlockAsync();
+ await InitiateMobileLoginAsync();
}
}
/// <summary>
- /// Initialize mobile unlock on component mount.
+ /// Initialize mobile login on component mount.
/// </summary>
- private async Task InitiateMobileUnlockAsync()
+ private async Task InitiateMobileLoginAsync()
{
try
{
@@ -103,19 +103,19 @@
_errorMessage = null;
StateHasChanged();
- // Initialize mobile unlock utility
- _mobileUnlockUtility = new MobileUnlockUtility(Http, JsInteropService, ScopedServices.GetRequiredService<ILogger<MobileUnlockUtility>>());
+ // Initialize mobile login utility
+ _mobileLoginUtility = new MobileLoginUtility(Http, JsInteropService, ScopedServices.GetRequiredService<ILogger<MobileLoginUtility>>());
- // Initiate mobile unlock and get QR code data
- var requestId = await _mobileUnlockUtility.InitiateAsync();
+ // Initiate mobile login and get QR code data
+ var requestId = await _mobileLoginUtility.InitiateAsync();
- // Generate QR code with AliasVault prefix for mobile unlock
- _qrCodeUrl = $"aliasvault://mobile-unlock/{requestId}";
+ // Generate QR code with AliasVault prefix for mobile login
+ _qrCodeUrl = $"aliasvault://mobile-login/{requestId}";
// Render QR code first while still showing loading animation
StateHasChanged();
await Task.Delay(100); // Give DOM time to render
- await JsInteropService.GenerateQrCode("mobile-unlock-qr");
+ await JsInteropService.GenerateQrCode("mobile-login-qr");
// Wait for QR code to be fully rendered before hiding loading animation
await Task.Delay(500);
@@ -127,7 +127,7 @@
StartCountdownTimer();
// Start polling for response
- await _mobileUnlockUtility.StartPollingAsync(
+ await _mobileLoginUtility.StartPollingAsync(
HandleSuccessfulAuthAsync,
HandleErrorAsync);
}
@@ -198,7 +198,7 @@
/// </summary>
private void HandleCancel()
{
- _mobileUnlockUtility?.Cleanup();
+ _mobileLoginUtility?.Cleanup();
_countdownTimer?.Dispose();
NavigationManager.NavigateTo("/user/login");
}
@@ -228,7 +228,7 @@
else
{
_countdownTimer?.Dispose();
- _mobileUnlockUtility?.StopPolling();
+ _mobileLoginUtility?.StopPolling();
}
}, null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1));
}
@@ -236,7 +236,7 @@
/// <inheritdoc/>
public void Dispose()
{
- _mobileUnlockUtility?.Dispose();
+ _mobileLoginUtility?.Dispose();
_countdownTimer?.Dispose();
}
}
diff --git a/apps/server/AliasVault.Client/Auth/Services/MobileUnlockUtility.cs b/apps/server/AliasVault.Client/Auth/Services/MobileLoginUtility.cs
similarity index 84%
rename from apps/server/AliasVault.Client/Auth/Services/MobileUnlockUtility.cs
rename to apps/server/AliasVault.Client/Auth/Services/MobileLoginUtility.cs
index 55b90f142..22d7d6617 100644
--- a/apps/server/AliasVault.Client/Auth/Services/MobileUnlockUtility.cs
+++ b/apps/server/AliasVault.Client/Auth/Services/MobileLoginUtility.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockUtility.cs" company="aliasvault">
+// <copyright file="MobileLoginUtility.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -18,11 +18,11 @@ using Microsoft.Extensions.Logging;
/// <summary>
/// Utility class for logging in with mobile app functionality.
/// </summary>
-public sealed class MobileUnlockUtility : IDisposable
+public sealed class MobileLoginUtility : IDisposable
{
private readonly HttpClient _httpClient;
private readonly JsInteropService _jsInteropService;
- private readonly ILogger<MobileUnlockUtility> _logger;
+ private readonly ILogger<MobileLoginUtility> _logger;
private Timer? _pollingTimer;
private string? _requestId;
@@ -30,12 +30,12 @@ public sealed class MobileUnlockUtility : IDisposable
private CancellationTokenSource? _cancellationTokenSource;
/// <summary>
- /// Initializes a new instance of the <see cref="MobileUnlockUtility"/> class.
+ /// Initializes a new instance of the <see cref="MobileLoginUtility"/> class.
/// </summary>
/// <param name="httpClient">The HTTP client.</param>
/// <param name="jsInteropService">The JS interop service.</param>
/// <param name="logger">The logger.</param>
- public MobileUnlockUtility(HttpClient httpClient, JsInteropService jsInteropService, ILogger<MobileUnlockUtility> logger)
+ public MobileLoginUtility(HttpClient httpClient, JsInteropService jsInteropService, ILogger<MobileLoginUtility> logger)
{
_httpClient = httpClient;
_jsInteropService = jsInteropService;
@@ -43,7 +43,7 @@ public sealed class MobileUnlockUtility : IDisposable
}
/// <summary>
- /// Initiates a mobile unlock request and returns the request ID for QR code generation.
+ /// Initiates a mobile login request and returns the request ID for QR code generation.
/// </summary>
/// <returns>The request ID.</returns>
/// <exception cref="HttpRequestException">Thrown when the request fails with status code.</exception>
@@ -54,18 +54,18 @@ public sealed class MobileUnlockUtility : IDisposable
_privateKey = keyPair.PrivateKey;
// Send public key to server
- var request = new MobileUnlockInitiateRequest(keyPair.PublicKey);
- var response = await _httpClient.PostAsJsonAsync("v1/Auth/mobile-unlock/initiate", request);
+ var request = new MobileLoginInitiateRequest(keyPair.PublicKey);
+ var response = await _httpClient.PostAsJsonAsync("v1/Auth/mobile-login/initiate", request);
if (!response.IsSuccessStatusCode)
{
- throw new HttpRequestException($"Failed to initiate mobile unlock: {response.StatusCode}", null, response.StatusCode);
+ throw new HttpRequestException($"Failed to initiate mobile login: {response.StatusCode}", null, response.StatusCode);
}
- var result = await response.Content.ReadFromJsonAsync<MobileUnlockInitiateResponse>();
+ var result = await response.Content.ReadFromJsonAsync<MobileLoginInitiateResponse>();
if (result == null)
{
- throw new InvalidOperationException("Failed to parse mobile unlock initiate response");
+ throw new InvalidOperationException("Failed to parse mobile login initiate response");
}
_requestId = result.RequestId;
@@ -73,7 +73,7 @@ public sealed class MobileUnlockUtility : IDisposable
}
/// <summary>
- /// Starts polling the server for mobile unlock response.
+ /// Starts polling the server for mobile login response.
/// </summary>
/// <param name="onSuccess">Callback for successful authentication.</param>
/// <param name="onError">Callback for errors.</param>
@@ -98,7 +98,7 @@ public sealed class MobileUnlockUtility : IDisposable
if (!_cancellationTokenSource.IsCancellationRequested)
{
StopPolling();
- onError("Mobile unlock request timed out");
+ onError("Mobile login request timed out");
}
},
TaskScheduler.Default);
@@ -143,7 +143,7 @@ public sealed class MobileUnlockUtility : IDisposable
try
{
- var response = await _httpClient.GetAsync($"v1/Auth/mobile-unlock/poll/{_requestId}");
+ var response = await _httpClient.GetAsync($"v1/Auth/mobile-login/poll/{_requestId}");
if (!response.IsSuccessStatusCode)
{
@@ -152,14 +152,14 @@ public sealed class MobileUnlockUtility : IDisposable
StopPolling();
_privateKey = null;
_requestId = null;
- onError("Mobile unlock request expired or not found");
+ onError("Mobile login request expired or not found");
return;
}
throw new InvalidOperationException($"Polling failed: {response.StatusCode}");
}
- var result = await response.Content.ReadFromJsonAsync<MobileUnlockPollResponse>();
+ var result = await response.Content.ReadFromJsonAsync<MobileLoginPollResponse>();
if (result?.Fulfilled == true && !string.IsNullOrEmpty(result.EncryptedDecryptionKey) && !string.IsNullOrEmpty(result.Username) && result.Token != null && !string.IsNullOrEmpty(result.Salt) && !string.IsNullOrEmpty(result.EncryptionType) && !string.IsNullOrEmpty(result.EncryptionSettings))
{
@@ -179,7 +179,7 @@ public sealed class MobileUnlockUtility : IDisposable
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error during mobile unlock polling");
+ _logger.LogError(ex, "Error during mobile login polling");
StopPolling();
_privateKey = null;
_requestId = null;
diff --git a/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx b/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
index 5c0cef4d4..849057e31 100644
--- a/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
+++ b/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
@@ -123,7 +123,7 @@
<comment>Link text for logging in with authenticator</comment>
</data>
<data name="MobileDeviceLink" xml:space="preserve">
- <value>Log in using mobile app</value>
+ <value>Log in using Mobile App</value>
<comment>Link text for mobile device login</comment>
</data>
<!-- Descriptions and help text -->
diff --git a/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx b/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileLogin.en.resx
similarity index 100%
rename from apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx
rename to apps/server/AliasVault.Client/Resources/Pages/Auth/MobileLogin.en.resx
diff --git a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
index e6dc25a1f..b2475ba9a 100644
--- a/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
+++ b/apps/server/Databases/AliasServerDb/AliasServerDbContext.cs
@@ -138,9 +138,9 @@ public class AliasServerDbContext : WorkerStatusDbContext, IDataProtectionKeyCon
public DbSet<TaskRunnerJob> TaskRunnerJobs { get; set; }
/// <summary>
- /// Gets or sets the MobileUnlockRequests DbSet.
+ /// Gets or sets the MobileLoginRequests DbSet.
/// </summary>
- public DbSet<MobileUnlockRequest> MobileUnlockRequests { get; set; }
+ public DbSet<MobileLoginRequest> MobileLoginRequests { get; set; }
/// <summary>
/// Sets up the connection string if it is not already configured.
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.Designer.cs b/apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.Designer.cs
similarity index 98%
rename from apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.Designer.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.Designer.cs
index 7978225d2..eeec7c7c1 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.Designer.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.Designer.cs
@@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace AliasServerDb.Migrations
{
[DbContext(typeof(AliasServerDbContext))]
- [Migration("20251115104944_AddMobileUnlockRequest")]
- partial class AddMobileUnlockRequest
+ [Migration("20251117162503_AddMobileLoginRequest")]
+ partial class AddMobileLoginRequest
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -491,7 +491,7 @@ namespace AliasServerDb.Migrations
b.ToTable("Logs", (string)null);
});
- modelBuilder.Entity("AliasServerDb.MobileUnlockRequest", b =>
+ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
@@ -515,9 +515,6 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptionType")
.HasColumnType("text");
- b.Property<bool>("Fulfilled")
- .HasColumnType("boolean");
-
b.Property<DateTime?>("FulfilledAt")
.HasColumnType("timestamp with time zone");
@@ -530,12 +527,17 @@ namespace AliasServerDb.Migrations
b.Property<string>("Salt")
.HasColumnType("text");
+ b.Property<string>("UserId")
+ .HasColumnType("text");
+
b.Property<string>("Username")
.HasColumnType("text");
b.HasKey("Id");
- b.ToTable("MobileUnlockRequests");
+ b.HasIndex("UserId");
+
+ b.ToTable("MobileLoginRequests");
});
modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
@@ -915,6 +917,15 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
+ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
+ {
+ b.HasOne("AliasServerDb.AliasVaultUser", "User")
+ .WithMany()
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
{
b.HasOne("AliasServerDb.AliasVaultUser", "User")
diff --git a/apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.cs b/apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.cs
similarity index 68%
rename from apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.cs
rename to apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.cs
index c62609e24..0487daa3d 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/20251115104944_AddMobileUnlockRequest.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/20251117162503_AddMobileLoginRequest.cs
@@ -6,13 +6,13 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace AliasServerDb.Migrations
{
/// <inheritdoc />
- public partial class AddMobileUnlockRequest : Migration
+ public partial class AddMobileLoginRequest : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
- name: "MobileUnlockRequests",
+ name: "MobileLoginRequests",
columns: table => new
{
Id = table.Column<string>(type: "text", nullable: false),
@@ -22,24 +22,34 @@ namespace AliasServerDb.Migrations
Salt = table.Column<string>(type: "text", nullable: true),
EncryptionType = table.Column<string>(type: "text", nullable: true),
EncryptionSettings = table.Column<string>(type: "text", nullable: true),
- Fulfilled = table.Column<bool>(type: "boolean", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
FulfilledAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
RetrievedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
ClientIpAddress = table.Column<string>(type: "text", nullable: true),
- MobileIpAddress = table.Column<string>(type: "text", nullable: true)
+ MobileIpAddress = table.Column<string>(type: "text", nullable: true),
+ UserId = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
- table.PrimaryKey("PK_MobileUnlockRequests", x => x.Id);
+ table.PrimaryKey("PK_MobileLoginRequests", x => x.Id);
+ table.ForeignKey(
+ name: "FK_MobileLoginRequests_AliasVaultUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AliasVaultUsers",
+ principalColumn: "Id");
});
+
+ migrationBuilder.CreateIndex(
+ name: "IX_MobileLoginRequests_UserId",
+ table: "MobileLoginRequests",
+ column: "UserId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
- name: "MobileUnlockRequests");
+ name: "MobileLoginRequests");
}
}
}
diff --git a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
index 82e2439c1..8fea293db 100644
--- a/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
+++ b/apps/server/Databases/AliasServerDb/Migrations/AliasServerDbContextModelSnapshot.cs
@@ -488,7 +488,7 @@ namespace AliasServerDb.Migrations
b.ToTable("Logs", (string)null);
});
- modelBuilder.Entity("AliasServerDb.MobileUnlockRequest", b =>
+ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
@@ -512,9 +512,6 @@ namespace AliasServerDb.Migrations
b.Property<string>("EncryptionType")
.HasColumnType("text");
- b.Property<bool>("Fulfilled")
- .HasColumnType("boolean");
-
b.Property<DateTime?>("FulfilledAt")
.HasColumnType("timestamp with time zone");
@@ -527,12 +524,17 @@ namespace AliasServerDb.Migrations
b.Property<string>("Salt")
.HasColumnType("text");
+ b.Property<string>("UserId")
+ .HasColumnType("text");
+
b.Property<string>("Username")
.HasColumnType("text");
b.HasKey("Id");
- b.ToTable("MobileUnlockRequests");
+ b.HasIndex("UserId");
+
+ b.ToTable("MobileLoginRequests");
});
modelBuilder.Entity("AliasServerDb.ServerSetting", b =>
@@ -912,6 +914,15 @@ namespace AliasServerDb.Migrations
b.Navigation("Email");
});
+ modelBuilder.Entity("AliasServerDb.MobileLoginRequest", b =>
+ {
+ b.HasOne("AliasServerDb.AliasVaultUser", "User")
+ .WithMany()
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
modelBuilder.Entity("AliasServerDb.UserEmailClaim", b =>
{
b.HasOne("AliasServerDb.AliasVaultUser", "User")
diff --git a/apps/server/Databases/AliasServerDb/MobileUnlockRequest.cs b/apps/server/Databases/AliasServerDb/MobileLoginRequest.cs
similarity index 85%
rename from apps/server/Databases/AliasServerDb/MobileUnlockRequest.cs
rename to apps/server/Databases/AliasServerDb/MobileLoginRequest.cs
index 0500fe294..613b56e77 100644
--- a/apps/server/Databases/AliasServerDb/MobileUnlockRequest.cs
+++ b/apps/server/Databases/AliasServerDb/MobileLoginRequest.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockRequest.cs" company="aliasvault">
+// <copyright file="MobileLoginRequest.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -10,7 +10,7 @@ namespace AliasServerDb;
/// <summary>
/// Mobile unlock request entity for storing temporary unlock requests.
/// </summary>
-public class MobileUnlockRequest
+public class MobileLoginRequest
{
/// <summary>
/// Gets or sets the unique identifier for this unlock request.
@@ -52,11 +52,6 @@ public class MobileUnlockRequest
/// </summary>
public string? EncryptionSettings { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether this request has been fulfilled.
- /// </summary>
- public bool Fulfilled { get; set; }
-
/// <summary>
/// Gets or sets the created timestamp.
/// </summary>
@@ -81,4 +76,15 @@ public class MobileUnlockRequest
/// Gets or sets the IP address of the mobile device that fulfilled the request.
/// </summary>
public string? MobileIpAddress { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user ID (foreign key to AliasVaultUser).
+ /// Null when record is created, populated when mobile app fulfills the request.
+ /// </summary>
+ public string? UserId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the navigation property to the user.
+ /// </summary>
+ public virtual AliasVaultUser? User { get; set; }
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
index 02b556682..137b0c5a4 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/Enums/ApiErrorCode.cs
@@ -135,12 +135,12 @@ public enum ApiErrorCode
VAULT_NOT_UP_TO_DATE,
/// <summary>
- /// Mobile unlock request not found or expired.
+ /// Mobile login request not found or expired.
/// </summary>
- MOBILE_UNLOCK_REQUEST_NOT_FOUND,
+ MOBILE_LOGIN_REQUEST_NOT_FOUND,
/// <summary>
- /// Mobile unlock request already fulfilled.
+ /// Mobile login request already fulfilled.
/// </summary>
- MOBILE_UNLOCK_REQUEST_ALREADY_FULFILLED,
+ MOBILE_LOGIN_REQUEST_ALREADY_FULFILLED,
}
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateRequest.cs
similarity index 71%
rename from apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateRequest.cs
rename to apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateRequest.cs
index b9f5ec0fd..2d65e4dd0 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateRequest.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateRequest.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockInitiateRequest.cs" company="aliasvault">
+// <copyright file="MobileLoginInitiateRequest.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.Auth;
/// <summary>
-/// Request model for initiating a mobile unlock request.
+/// Request model for initiating a mobile login request.
/// </summary>
/// <param name="ClientPublicKey">The public key from the client (base64 encoded).</param>
-public record MobileUnlockInitiateRequest(string ClientPublicKey);
+public record MobileLoginInitiateRequest(string ClientPublicKey);
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateResponse.cs
similarity index 59%
rename from apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateResponse.cs
rename to apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateResponse.cs
index 9f319ca71..a0e2ecba5 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockInitiateResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginInitiateResponse.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockInitiateResponse.cs" company="aliasvault">
+// <copyright file="MobileLoginInitiateResponse.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.Auth;
/// <summary>
-/// Response model for mobile unlock initiate request.
+/// Response model for mobile login initiate request.
/// </summary>
-/// <param name="RequestId">The unique identifier for this unlock request.</param>
-public record MobileUnlockInitiateResponse(string RequestId);
+/// <param name="RequestId">The unique identifier for this login request.</param>
+public record MobileLoginInitiateResponse(string RequestId);
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockPollResponse.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginPollResponse.cs
similarity index 87%
rename from apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockPollResponse.cs
rename to apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginPollResponse.cs
index 0f21ce0ea..d60d547d9 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockPollResponse.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginPollResponse.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockPollResponse.cs" company="aliasvault">
+// <copyright file="MobileLoginPollResponse.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -8,7 +8,7 @@
namespace AliasVault.Shared.Models.WebApi.Auth;
/// <summary>
-/// Response model for polling mobile unlock status.
+/// Response model for polling mobile login status.
/// </summary>
/// <param name="Fulfilled">Whether the request has been fulfilled by the mobile app.</param>
/// <param name="EncryptedDecryptionKey">The encrypted decryption key (base64 encoded) if fulfilled.</param>
@@ -17,7 +17,7 @@ namespace AliasVault.Shared.Models.WebApi.Auth;
/// <param name="Salt">The salt for key derivation if fulfilled.</param>
/// <param name="EncryptionType">The encryption type if fulfilled.</param>
/// <param name="EncryptionSettings">The encryption settings if fulfilled.</param>
-public record MobileUnlockPollResponse(
+public record MobileLoginPollResponse(
bool Fulfilled,
string? EncryptedDecryptionKey,
string? Username,
diff --git a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockSubmitRequest.cs b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginSubmitRequest.cs
similarity index 62%
rename from apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockSubmitRequest.cs
rename to apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginSubmitRequest.cs
index 1545dbd1a..a874ab462 100644
--- a/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileUnlockSubmitRequest.cs
+++ b/apps/server/Shared/AliasVault.Shared/Models/WebApi/Auth/MobileLoginSubmitRequest.cs
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
-// <copyright file="MobileUnlockSubmitRequest.cs" company="aliasvault">
+// <copyright file="MobileLoginSubmitRequest.cs" company="aliasvault">
// Copyright (c) aliasvault. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
// </copyright>
@@ -8,9 +8,9 @@
namespace AliasVault.Shared.Models.WebApi.Auth;
/// <summary>
-/// Request model for submitting mobile unlock response from mobile app.
+/// Request model for submitting mobile login response from mobile app.
/// </summary>
-/// <param name="RequestId">The unique identifier for this unlock request.</param>
+/// <param name="RequestId">The unique identifier for this login request.</param>
/// <param name="EncryptedDecryptionKey">The encrypted decryption key (base64 encoded).</param>
/// <param name="Username">The username of the user logging in.</param>
-public record MobileUnlockSubmitRequest(string RequestId, string EncryptedDecryptionKey, string Username);
+public record MobileLoginSubmitRequest(string RequestId, string EncryptedDecryptionKey, string Username);
diff --git a/shared/models/src/webapi/MobileUnlock.ts b/shared/models/src/webapi/MobileLogin.ts
similarity index 58%
rename from shared/models/src/webapi/MobileUnlock.ts
rename to shared/models/src/webapi/MobileLogin.ts
index 04792b3ba..e4112e651 100644
--- a/shared/models/src/webapi/MobileUnlock.ts
+++ b/shared/models/src/webapi/MobileLogin.ts
@@ -1,32 +1,32 @@
import type { TokenModel } from './ValidateLogin';
/**
- * Mobile unlock initiate request type.
+ * Mobile login initiate request type.
*/
-export type MobileUnlockInitiateRequest = {
+export type MobileLoginInitiateRequest = {
clientPublicKey: string;
}
/**
- * Mobile unlock initiate response type.
+ * Mobile login initiate response type.
*/
-export type MobileUnlockInitiateResponse = {
+export type MobileLoginInitiateResponse = {
requestId: string;
}
/**
- * Mobile unlock submit request type.
+ * Mobile login submit request type.
*/
-export type MobileUnlockSubmitRequest = {
+export type MobileLoginSubmitRequest = {
requestId: string;
encryptedDecryptionKey: string;
username: string;
}
/**
- * Mobile unlock poll response type.
+ * Mobile login poll response type.
*/
-export type MobileUnlockPollResponse = {
+export type MobileLoginPollResponse = {
fulfilled: boolean;
encryptedDecryptionKey: string | null;
username: string | null;
diff --git a/shared/models/src/webapi/index.ts b/shared/models/src/webapi/index.ts
index 53b9a1068..43ea8d481 100644
--- a/shared/models/src/webapi/index.ts
+++ b/shared/models/src/webapi/index.ts
@@ -21,4 +21,4 @@ export * from './PasswordChangeInitiateResponse';
export * from './VaultPasswordChangeRequest';
export * from './BadRequestResponse';
export * from './AuthEventType';
-export * from './MobileUnlock';
+export * from './MobileLogin';