Skip to content

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

Update login screen (#771)

Leendert de Borstfb318c7669ab
diff --git a/apps/mobile-app/app/_layout.tsx b/apps/mobile-app/app/_layout.tsx
index 93c909942..1ae006a5e 100644
--- a/apps/mobile-app/app/_layout.tsx
+++ b/apps/mobile-app/app/_layout.tsx
@@ -57,16 +57,16 @@ function RootLayoutNav() : React.ReactNode {
headerStyle: {
backgroundColor: colors.accentBackground,
},
- headerTintColor: colors.text,
+ headerTintColor: colors.primary,
headerTitleStyle: {
- fontWeight: 'bold',
+ color: colors.text,
},
}}>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="login" options={{ title: 'Login', headerShown: false }} />
+ <Stack.Screen name="login-settings" options={{ title: 'Login Settings' }} />
<Stack.Screen name="sync" options={{ headerShown: false }} />
<Stack.Screen name="unlock" options={{ headerShown: false }} />
- <Stack.Screen name="settings" options={{ title: 'Settings', headerShown: true }} />
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="+not-found" options={{ title: 'Not Found' }} />
</Stack>
diff --git a/apps/mobile-app/app/settings.tsx b/apps/mobile-app/app/login-settings.tsx
similarity index 97%
rename from apps/mobile-app/app/settings.tsx
rename to apps/mobile-app/app/login-settings.tsx
index 194e2b3aa..5e61527aa 100644
--- a/apps/mobile-app/app/settings.tsx
+++ b/apps/mobile-app/app/login-settings.tsx
@@ -97,6 +97,7 @@ export default function SettingsScreen() : React.ReactNode {
marginBottom: 8,
},
optionButton: {
+ backgroundColor: colors.accentBackground,
borderColor: colors.accentBorder,
borderRadius: 8,
borderWidth: 1,
@@ -146,12 +147,10 @@ export default function SettingsScreen() : React.ReactNode {
<SafeAreaView style={styles.container}>
<ThemedView style={styles.content}>
<View style={styles.titleContainer}>
- <Text style={styles.title}>Settings</Text>
+ <Text style={styles.title}>API Connection</Text>
</View>
<View style={styles.formContainer}>
- <Text style={styles.label}>API Connection</Text>
-
{DEFAULT_OPTIONS.map(option => (
<TouchableOpacity
key={option.value}
diff --git a/apps/mobile-app/app/login.tsx b/apps/mobile-app/app/login.tsx
index 491d53161..b77c1e215 100644
--- a/apps/mobile-app/app/login.tsx
+++ b/apps/mobile-app/app/login.tsx
@@ -1,11 +1,26 @@
import { Buffer } from 'buffer';
import React, { useState, useEffect } from 'react';
-import { StyleSheet, View, Text, SafeAreaView, TextInput, TouchableOpacity, ActivityIndicator, Linking, Animated } from 'react-native';
+import {
+ StyleSheet,
+ View,
+ Text,
+ SafeAreaView,
+ TextInput,
+ TouchableOpacity,
+ ActivityIndicator,
+ Linking,
+ Animated,
+ ScrollView,
+ KeyboardAvoidingView,
+ Platform,
+ Dimensions
+} from 'react-native';
import { router } from 'expo-router';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { useFocusEffect } from '@react-navigation/native';
import { MaterialIcons } from '@expo/vector-icons';
+import { LinearGradient } from 'expo-linear-gradient';
import { ThemedView } from '@/components/themed/ThemedView';
import { useDb } from '@/context/DbContext';
@@ -326,11 +341,17 @@ export default function LoginScreen() : React.ReactNode {
formContainer: {
gap: 16,
},
+ gradientContainer: {
+ height: Dimensions.get('window').height * 0.4,
+ left: 0,
+ position: 'absolute',
+ right: 0,
+ top: 0,
+ },
headerContainer: {
marginBottom: 24,
},
headerSection: {
- backgroundColor: colors.loginHeader,
borderBottomLeftRadius: 24,
borderBottomRightRadius: 24,
paddingBottom: 24,
@@ -395,171 +416,188 @@ export default function LoginScreen() : React.ReactNode {
color: colors.text,
fontSize: 14,
},
+ scrollContent: {
+ flexGrow: 1,
+ },
secondaryButton: {
backgroundColor: colors.secondary,
},
});
return (
- <View style={styles.container}>
- <SafeAreaView style={{ backgroundColor: colors.loginHeader }}>
- <Animated.View style={[styles.headerSection, { opacity: fadeAnim }]}>
- <View style={styles.logoContainer}>
- <Logo width={80} height={80} />
- <Text style={styles.appName}>AliasVault</Text>
- </View>
- </Animated.View>
- </SafeAreaView>
- <ThemedView style={styles.content}>
- {isLoading ? (
- <LoadingIndicator status={loginStatus ?? 'Loading...'} />
- ) : (
- <>
- <View style={styles.headerContainer}>
- <Text style={styles.headerTitle}>Log in</Text>
- <Text style={styles.headerSubtitle}>
- Connecting to{' '}
- <Text
- style={styles.clickableDomain}
- onPress={() => router.push('/settings')}
- >
- {getDisplayUrl()}
- </Text>
- </Text>
+ <KeyboardAvoidingView
+ behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
+ style={styles.container}
+ >
+ <ScrollView
+ style={styles.container}
+ contentContainerStyle={styles.scrollContent}
+ keyboardShouldPersistTaps="handled"
+ >
+
+ <SafeAreaView>
+ <LinearGradient
+ colors={[colors.loginHeader, colors.background]}
+ style={styles.gradientContainer}
+ />
+ <Animated.View style={[styles.headerSection, { opacity: fadeAnim }]}>
+ <View style={styles.logoContainer}>
+ <Logo width={80} height={80} />
+ <Text style={styles.appName}>AliasVault</Text>
</View>
-
- {error && (
- <View style={styles.errorContainer}>
- <Text style={styles.errorText}>{error}</Text>
+ </Animated.View>
+ </SafeAreaView>
+ <ThemedView style={styles.content}>
+ {isLoading ? (
+ <LoadingIndicator status={loginStatus ?? 'Loading...'} />
+ ) : (
+ <>
+ <View style={styles.headerContainer}>
+ <Text style={styles.headerTitle}>Log in</Text>
+ <Text style={styles.headerSubtitle}>
+ Connecting to{' '}
+ <Text
+ style={styles.clickableDomain}
+ onPress={() => router.push('/login-settings')}
+ >
+ {getDisplayUrl()}
+ </Text>
+ </Text>
</View>
- )}
-
- {twoFactorRequired ? (
- <View style={styles.formContainer}>
- <Text style={styles.label}>Authentication Code</Text>
- <View style={styles.inputContainer}>
- <MaterialIcons
- name="security"
- size={24}
- color={colors.textMuted}
- style={styles.inputIcon}
- />
- <TextInput
- style={styles.input}
- value={twoFactorCode}
- onChangeText={setTwoFactorCode}
- autoCorrect={false}
- autoCapitalize="none"
- placeholder="Enter 6-digit code"
- keyboardType="numeric"
- maxLength={6}
- placeholderTextColor={colors.textMuted}
- />
+
+ {error && (
+ <View style={styles.errorContainer}>
+ <Text style={styles.errorText}>{error}</Text>
+ </View>
+ )}
+
+ {twoFactorRequired ? (
+ <View style={styles.formContainer}>
+ <Text style={styles.label}>Authentication Code</Text>
+ <View style={styles.inputContainer}>
+ <MaterialIcons
+ name="security"
+ size={24}
+ color={colors.textMuted}
+ style={styles.inputIcon}
+ />
+ <TextInput
+ style={styles.input}
+ value={twoFactorCode}
+ onChangeText={setTwoFactorCode}
+ autoCorrect={false}
+ autoCapitalize="none"
+ placeholder="Enter 6-digit code"
+ keyboardType="numeric"
+ maxLength={6}
+ placeholderTextColor={colors.textMuted}
+ />
+ </View>
+ <View style={styles.buttonContainer}>
+ <TouchableOpacity
+ style={[styles.button, styles.primaryButton]}
+ onPress={handleTwoFactorSubmit}
+ disabled={isLoading}
+ >
+ {isLoading ? (
+ <ActivityIndicator color={colors.text} />
+ ) : (
+ <Text style={styles.buttonText}>Verify</Text>
+ )}
+ </TouchableOpacity>
+ <TouchableOpacity
+ style={[styles.button, styles.secondaryButton]}
+ onPress={() => {
+ setCredentials({ username: '', password: '' });
+ setTwoFactorRequired(false);
+ setTwoFactorCode('');
+ setPasswordHashString(null);
+ setPasswordHashBase64(null);
+ setLoginResponse(null);
+ setError(null);
+ }}
+ >
+ <Text style={styles.buttonText}>Cancel</Text>
+ </TouchableOpacity>
+ </View>
+ <Text style={styles.noteText}>
+ Note: if you don&apos;t have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.
+ </Text>
</View>
- <View style={styles.buttonContainer}>
+ ) : (
+ <View style={styles.formContainer}>
+ <Text style={styles.label}>Username or email</Text>
+ <View style={styles.inputContainer}>
+ <MaterialIcons
+ name="person"
+ size={24}
+ color={colors.textMuted}
+ style={styles.inputIcon}
+ />
+ <TextInput
+ style={styles.input}
+ value={credentials.username}
+ onChangeText={(text) => setCredentials({ ...credentials, username: text })}
+ placeholder="name / [email protected]"
+ autoCapitalize="none"
+ autoCorrect={false}
+ placeholderTextColor={colors.textMuted}
+ />
+ </View>
+ <Text style={styles.label}>Password</Text>
+ <View style={styles.inputContainer}>
+ <MaterialIcons
+ name="lock"
+ size={24}
+ color={colors.textMuted}
+ style={styles.inputIcon}
+ />
+ <TextInput
+ style={styles.input}
+ value={credentials.password}
+ onChangeText={(text) => setCredentials({ ...credentials, password: text })}
+ placeholder="Enter your password"
+ secureTextEntry
+ placeholderTextColor={colors.textMuted}
+ autoCorrect={false}
+ autoCapitalize="none"
+ />
+ </View>
+ <View style={styles.rememberMeContainer}>
+ <TouchableOpacity
+ style={styles.checkbox}
+ onPress={() => setRememberMe(!rememberMe)}
+ >
+ <View style={[styles.checkboxInner, rememberMe && styles.checkboxChecked]} />
+ </TouchableOpacity>
+ <Text style={styles.rememberMeText}>Remember me</Text>
+ </View>
<TouchableOpacity
style={[styles.button, styles.primaryButton]}
- onPress={handleTwoFactorSubmit}
+ onPress={handleSubmit}
disabled={isLoading}
>
{isLoading ? (
<ActivityIndicator color={colors.text} />
) : (
- <Text style={styles.buttonText}>Verify</Text>
+ <Text style={styles.buttonText}>Login</Text>
)}
</TouchableOpacity>
- <TouchableOpacity
- style={[styles.button, styles.secondaryButton]}
- onPress={() => {
- setCredentials({ username: '', password: '' });
- setTwoFactorRequired(false);
- setTwoFactorCode('');
- setPasswordHashString(null);
- setPasswordHashBase64(null);
- setLoginResponse(null);
- setError(null);
- }}
- >
- <Text style={styles.buttonText}>Cancel</Text>
- </TouchableOpacity>
- </View>
- <Text style={styles.noteText}>
- Note: if you don&apos;t have access to your authenticator device, you can reset your 2FA with a recovery code by logging in via the website.
- </Text>
- </View>
- ) : (
- <View style={styles.formContainer}>
- <Text style={styles.label}>Username or email</Text>
- <View style={styles.inputContainer}>
- <MaterialIcons
- name="person"
- size={24}
- color={colors.textMuted}
- style={styles.inputIcon}
- />
- <TextInput
- style={styles.input}
- value={credentials.username}
- onChangeText={(text) => setCredentials({ ...credentials, username: text })}
- placeholder="name / [email protected]"
- autoCapitalize="none"
- autoCorrect={false}
- placeholderTextColor={colors.textMuted}
- />
- </View>
- <Text style={styles.label}>Password</Text>
- <View style={styles.inputContainer}>
- <MaterialIcons
- name="lock"
- size={24}
- color={colors.textMuted}
- style={styles.inputIcon}
- />
- <TextInput
- style={styles.input}
- value={credentials.password}
- onChangeText={(text) => setCredentials({ ...credentials, password: text })}
- placeholder="Enter your password"
- secureTextEntry
- placeholderTextColor={colors.textMuted}
- autoCorrect={false}
- autoCapitalize="none"
- />
- </View>
- <View style={styles.rememberMeContainer}>
- <TouchableOpacity
- style={styles.checkbox}
- onPress={() => setRememberMe(!rememberMe)}
- >
- <View style={[styles.checkboxInner, rememberMe && styles.checkboxChecked]} />
- </TouchableOpacity>
- <Text style={styles.rememberMeText}>Remember me</Text>
- </View>
- <TouchableOpacity
- style={[styles.button, styles.primaryButton]}
- onPress={handleSubmit}
- disabled={isLoading}
- >
- {isLoading ? (
- <ActivityIndicator color={colors.text} />
- ) : (
- <Text style={styles.buttonText}>Login</Text>
- )}
- </TouchableOpacity>
- <Text style={styles.noteText}>
- No account yet?{' '}
- <Text
- style={styles.clickableDomain}
- onPress={() => Linking.openURL('https://app.aliasvault.net')}
- >
- Create new vault
+ <Text style={styles.noteText}>
+ No account yet?{' '}
+ <Text
+ style={styles.clickableDomain}
+ onPress={() => Linking.openURL('https://app.aliasvault.net')}
+ >
+ Create new vault
+ </Text>
</Text>
- </Text>
- </View>
- )}
- </>
- )}
- </ThemedView>
- </View>
+ </View>
+ )}
+ </>
+ )}
+ </ThemedView>
+ </ScrollView>
+ </KeyboardAvoidingView>
);
}
\ No newline at end of file
diff --git a/apps/mobile-app/ios/Podfile.lock b/apps/mobile-app/ios/Podfile.lock
index 8c0d06b74..147bdc7ae 100644
--- a/apps/mobile-app/ios/Podfile.lock
+++ b/apps/mobile-app/ios/Podfile.lock
@@ -232,6 +232,8 @@ PODS:
- ExpoModulesCore
- ExpoKeepAwake (14.0.3):
- ExpoModulesCore
+ - ExpoLinearGradient (14.0.2):
+ - ExpoModulesCore
- ExpoLinking (7.0.5):
- ExpoModulesCore
- ExpoLocalAuthentication (15.0.2):
@@ -2194,6 +2196,7 @@ DEPENDENCIES:
- ExpoHaptics (from `../node_modules/expo-haptics/ios`)
- ExpoHead (from `../node_modules/expo-router/ios`)
- ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`)
+ - ExpoLinearGradient (from `../node_modules/expo-linear-gradient/ios`)
- ExpoLinking (from `../node_modules/expo-linking/ios`)
- ExpoLocalAuthentication (from `../node_modules/expo-local-authentication/ios`)
- ExpoModulesCore (from `../node_modules/expo-modules-core`)
@@ -2330,6 +2333,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/expo-router/ios"
ExpoKeepAwake:
:path: "../node_modules/expo-keep-awake/ios"
+ ExpoLinearGradient:
+ :path: "../node_modules/expo-linear-gradient/ios"
ExpoLinking:
:path: "../node_modules/expo-linking/ios"
ExpoLocalAuthentication:
@@ -2518,6 +2523,7 @@ SPEC CHECKSUMS:
ExpoHaptics: 8d199b2f33245ea85289ff6c954c7ee7c00a5b5d
ExpoHead: cee2d16ef197aaadb0ac481cf221a663636eb074
ExpoKeepAwake: b0171a73665bfcefcfcc311742a72a956e6aa680
+ ExpoLinearGradient: 35ebd83b16f80b3add053a2fd68cc328ed927f60
ExpoLinking: 8d12bee174ba0cdf31239706578e29e74a417402
ExpoLocalAuthentication: eb2be9c7bcdc68e9434d4be4bb5aa5cf7943e816
ExpoModulesCore: c25d77625038b1968ea1afefc719862c0d8dd993
diff --git a/apps/mobile-app/package-lock.json b/apps/mobile-app/package-lock.json
index c2d3e5afa..f715e94e1 100644
--- a/apps/mobile-app/package-lock.json
+++ b/apps/mobile-app/package-lock.json
@@ -21,6 +21,7 @@
"expo-dev-client": "~5.0.19",
"expo-font": "~13.0.4",
"expo-haptics": "~14.0.1",
+ "expo-linear-gradient": "~14.0.2",
"expo-linking": "~7.0.5",
"expo-local-authentication": "~15.0.2",
"expo-modules-core": "~2.2.3",
@@ -9910,6 +9911,17 @@
"react": "*"
}
},
+ "node_modules/expo-linear-gradient": {
+ "version": "14.0.2",
+ "resolved": "https://registry.npmjs.org/expo-linear-gradient/-/expo-linear-gradient-14.0.2.tgz",
+ "integrity": "sha512-nvac1sPUfFFJ4mY25UkvubpUV/olrBH+uQw5k+beqSvQaVQiUfFtYzfRr+6HhYBNb4AEsOtpsCRkpDww3M2iGQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "expo": "*",
+ "react": "*",
+ "react-native": "*"
+ }
+ },
"node_modules/expo-linking": {
"version": "7.0.5",
"resolved": "https://registry.npmjs.org/expo-linking/-/expo-linking-7.0.5.tgz",
diff --git a/apps/mobile-app/package.json b/apps/mobile-app/package.json
index 151d46ef6..5e19cdb18 100644
--- a/apps/mobile-app/package.json
+++ b/apps/mobile-app/package.json
@@ -73,7 +73,8 @@
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"secure-remote-password": "github:LinusU/secure-remote-password#73e5f732b6ca0cdbdc19da1a0c5f48cdbad2cbf0",
- "yup": "^1.6.1"
+ "yup": "^1.6.1",
+ "expo-linear-gradient": "~14.0.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",