mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-04-16 12:38:56 -04:00
Cleanup (#1347)
This commit is contained in:
@@ -48,7 +48,6 @@ export const NavigationProvider: React.FC<{ children: React.ReactNode }> = ({ ch
|
||||
'/',
|
||||
'/reinitialize',
|
||||
'/login',
|
||||
'/mobile-login',
|
||||
'/unlock',
|
||||
'/unlock-success',
|
||||
'/auth-settings',
|
||||
|
||||
@@ -33,7 +33,6 @@ export default function MobileUnlockConfirmScreen() : React.ReactNode {
|
||||
const handleMobileLogin = async (id: string) : Promise<void> => {
|
||||
try {
|
||||
// Fetch the public key from server
|
||||
console.log('makig request to /auth/mobile-login/request', id);
|
||||
const response = await webApi.authFetch<{ clientPublicKey: string }>(
|
||||
`auth/mobile-login/request/${id}`,
|
||||
{ method: 'GET' }
|
||||
@@ -210,8 +209,6 @@ export default function MobileUnlockConfirmScreen() : React.ReactNode {
|
||||
},
|
||||
});
|
||||
|
||||
console.log('[_qrconfirm] rendered with id:', id);
|
||||
|
||||
// Show loading during processing
|
||||
if (isProcessing) {
|
||||
return (
|
||||
|
||||
@@ -112,7 +112,6 @@ export default function QRScannerScreen() : React.ReactNode {
|
||||
*/
|
||||
setIsLoadingAfterScan(false);
|
||||
|
||||
console.log('[_qrscanner] navigate to mobile-unlock with replace:', parsedData.payload);
|
||||
router.replace(`/(tabs)/settings/mobile-unlock/${parsedData.payload}` as Href);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -50,7 +50,6 @@ export default function ActionHandler() : null {
|
||||
}
|
||||
|
||||
// First navigate to settings tab to establish correct navigation stack
|
||||
console.log('[_actionhandler] navigate to qr-confirm');
|
||||
router.replace(`/(tabs)/settings/mobile-unlock/${requestId}` as Href);
|
||||
setHasNavigated(true);
|
||||
break;
|
||||
|
||||
@@ -83,8 +83,6 @@ export function CredentialCard({ credential, onCredentialDelete }: CredentialCar
|
||||
const handleContextMenuAction = async (event: OnPressMenuItemEvent): Promise<void> => {
|
||||
const { name } = event.nativeEvent;
|
||||
|
||||
console.log('handleContextMenuAction', name);
|
||||
|
||||
switch (name) {
|
||||
case t('credentials.contextMenu.edit'):
|
||||
Keyboard.dismiss();
|
||||
|
||||
@@ -195,7 +195,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||
* This is called by AppContext after revoking tokens on the server.
|
||||
*/
|
||||
const clearAuth = useCallback(async (errorMessage?: string): Promise<void> => {
|
||||
console.log('Clearing auth --- attempt');
|
||||
// Clear credential identity store (password and passkey autofill metadata)
|
||||
try {
|
||||
await NativeVaultManager.removeCredentialIdentities();
|
||||
@@ -439,7 +438,6 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
|
||||
// Check if vault is unlocked.
|
||||
const isUnlocked = await isVaultUnlocked();
|
||||
if (!isUnlocked) {
|
||||
console.log('-------- vault NOT unlocked trigger detection here ---------------------')
|
||||
// Get current full URL including query params
|
||||
const currentRoute = lastRouteRef.current;
|
||||
if (currentRoute?.path) {
|
||||
|
||||
@@ -99,14 +99,12 @@ export class PostUnlockNavigation {
|
||||
|
||||
// Priority 1: Handle pending deep link (e.g. from QR code scan or native autofill interface)
|
||||
if (pendingDeepLink) {
|
||||
console.log('[_postunlocknavigation] navigate with pendingDeepLink:', pendingDeepLink);
|
||||
this.handlePendingDeepLink(pendingDeepLink, router);
|
||||
return;
|
||||
}
|
||||
|
||||
// Priority 2: Handle return URL (from reinitialize flow)
|
||||
if (returnUrl?.path) {
|
||||
console.log('[_postunlocknavigation] navigate with returnUrl:', returnUrl);
|
||||
this.handleReturnUrl(returnUrl, router);
|
||||
if (clearReturnUrl) {
|
||||
clearReturnUrl();
|
||||
|
||||
@@ -597,7 +597,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
|
||||
var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == requestId);
|
||||
|
||||
// Check if request exists and hasn't expired
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddSeconds(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
{
|
||||
return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
|
||||
}
|
||||
@@ -697,7 +697,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
|
||||
var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == requestId);
|
||||
|
||||
// Check if request exists and hasn't expired
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddSeconds(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
{
|
||||
return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
|
||||
}
|
||||
@@ -727,7 +727,7 @@ public class AuthController(IAliasServerDbContextFactory dbContextFactory, UserM
|
||||
var loginRequest = await context.MobileLoginRequests.FirstOrDefaultAsync(r => r.Id == model.RequestId);
|
||||
|
||||
// Check if request exists and hasn't expired
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddMinutes(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
if (loginRequest == null || loginRequest.CreatedAt.AddSeconds(MobileLoginTimeoutMinutes) < timeProvider.UtcNow)
|
||||
{
|
||||
return NotFound(ApiErrorCodeHelper.CreateErrorResponse(ApiErrorCode.MOBILE_LOGIN_REQUEST_NOT_FOUND, 404));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user