Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add terms and conditions step (#306)
Leendert de Borst862f013bda24
diff --git a/src/AliasVault.Client/Auth/Pages/Setup/Components/PurposeStep.razor b/src/AliasVault.Client/Auth/Pages/Setup/Components/PurposeStep.razordeleted file mode 100644index 265e793ac..000000000--- a/src/AliasVault.Client/Auth/Pages/Setup/Components/PurposeStep.razor+++ /dev/null@@ -1,82 +0,0 @@-@using System.Timers--<div class="w-full max-w-md mx-auto">- @if (isLoading)- {- <div class="absolute inset-0 flex justify-center items-center z-10">- <div class="animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-primary-500"></div>- </div>- }- <div class="@(isLoading ? "invisible opacity-0" : "opacity-100") transition-opacity duration-300 w-full">- <div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg lg:shadow-none p-6 mb-6">- <div class="flex items-start mb-4">- <div class="flex-shrink-0">- <img class="h-10 w-10 rounded-full" src="/img/avatar.webp" alt="AliasVault Assistant">- </div>- <div class="ml-3 bg-blue-100 dark:bg-blue-900 rounded-lg p-3">- <p class="text-sm text-gray-900 dark:text-white">- Hi there! I'll help you get your AliasVault account setup.- </p>- <p class="text-sm text-gray-900 dark:text-white mt-3">- In order to help you better, what's the main purpose you want to use AliasVault for?- </p>- </div>- </div>- </div>-- <div class="space-y-4">- @foreach (var purpose in Purposes)- {- <button @onclick="() => SelectPurpose(purpose.Key)"- class="w-full text-left p-4 rounded-lg border @(Purpose == purpose.Key ? "border-blue-500 bg-blue-50 dark:bg-blue-900" : "border-gray-300 dark:border-gray-700") hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors">- <h3 class="text-lg font-semibold text-gray-900 dark:text-white">@purpose.Key</h3>- <p class="text-sm text-gray-600 dark:text-gray-400">@purpose.Value</p>- </button>- }- </div>- </div>-</div>--@code {- [Parameter]- public string Purpose { get; set; } = string.Empty;-- [Parameter]- public EventCallback<string> OnPurposeChange { get; set; }-- [Parameter]- public bool IsPurposeSelected { get; set; }-- private Dictionary<string, string> Purposes = new()- {- { "Personal Security", "I want to enhance my online security by creating unique identities and passwords for my personal accounts." },- { "Privacy Protection", "I'm concerned about online tracking and want to use email aliases to protect my privacy." },- };-- private bool isLoading = true;- private Timer? loadingTimer;-- protected override void OnInitialized()- {- loadingTimer = new Timer(300);- loadingTimer.Elapsed += (sender, e) => FinishLoading();- loadingTimer.AutoReset = false;- loadingTimer.Start();- }-- private void FinishLoading()- {- isLoading = false;- InvokeAsync(StateHasChanged);- }-- public void Dispose()- {- loadingTimer?.Dispose();- }-- private async Task SelectPurpose(string purpose)- {- await OnPurposeChange.InvokeAsync(purpose);- }-}diff --git a/src/AliasVault.Client/Auth/Pages/Setup/Components/TermsAndConditionsStep.razor b/src/AliasVault.Client/Auth/Pages/Setup/Components/TermsAndConditionsStep.razornew file mode 100644index 000000000..7b6180670--- /dev/null+++ b/src/AliasVault.Client/Auth/Pages/Setup/Components/TermsAndConditionsStep.razor@@ -0,0 +1,73 @@+@using System.Timers++<div class="w-full max-w-md mx-auto">+ @if (isLoading)+ {+ <div class="absolute inset-0 flex justify-center items-center z-10">+ <div class="animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-primary-500"></div>+ </div>+ }+ <div class="@(isLoading ? "invisible opacity-0" : "opacity-100") transition-opacity duration-300 w-full">+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg lg:shadow-none p-6">+ <h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-4">Using AliasVault</h2>+ <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">+ Please read and agree to the following terms and conditions before proceeding.+ </p>+ <div class="bg-gray-100 dark:bg-gray-700 rounded-lg p-4 mb-8 h-80 overflow-y-auto">+ <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">Terms and Conditions</h3>+ <p class="text-sm text-gray-600 dark:text-gray-400">+ AliasVault is designed to enhance your online security and protect your privacy. With AliasVault, you can create unique identities and email aliases for your various online accounts, helping you maintain control over your personal information and reduce the risk of identity theft.+ <br><br>+ By using AliasVault, you agree to the following terms:+ <br><br>+ 1. You will not use AliasVault for any illegal purposes, including but not limited to fraud, identity theft, or impersonating real individuals.+ <br><br>+ 2. You are responsible for maintaining the confidentiality of your account and any aliases created through AliasVault.+ <br><br>+ 3. AliasVault reserves the right to terminate your account if we suspect any misuse or violation of these terms.+ <br><br>+ 4. You understand that while AliasVault enhances your privacy, no system is completely foolproof, and you use the service at your own risk.+ </p>+ </div>+ <div class="flex items-center">+ <input type="checkbox" id="agreeTerms" @bind="agreedToTerms" @bind:after="OnAgreedToTerms" class="mr-2">+ <label for="agreeTerms" class="text-sm font-bold text-gray-600 dark:text-gray-400">+ I have read and agree to the Terms and Conditions+ </label>+ </div>+ </div>+ </div>+</div>++@code {+ [Parameter]+ public EventCallback<bool> OnAgreedToTermsChanged { get; set; }++ private bool isLoading = true;+ private Timer? loadingTimer;+ private bool agreedToTerms = false;++ protected override void OnInitialized()+ {+ loadingTimer = new Timer(300);+ loadingTimer.Elapsed += (sender, e) => FinishLoading();+ loadingTimer.AutoReset = false;+ loadingTimer.Start();+ }++ private void FinishLoading()+ {+ isLoading = false;+ InvokeAsync(StateHasChanged);+ }++ public void Dispose()+ {+ loadingTimer?.Dispose();+ }++ private async Task OnAgreedToTerms()+ {+ await OnAgreedToTermsChanged.InvokeAsync(agreedToTerms);+ }+}diff --git a/src/AliasVault.Client/Auth/Pages/Setup/Components/WelcomeStep.razor b/src/AliasVault.Client/Auth/Pages/Setup/Components/WelcomeStep.razorindex e1b423635..4bc6c427d 100644--- a/src/AliasVault.Client/Auth/Pages/Setup/Components/WelcomeStep.razor+++ b/src/AliasVault.Client/Auth/Pages/Setup/Components/WelcomeStep.razor@@ -1,7 +1,7 @@<div class="w-full max-w-md mx-auto">- <h2 class="mt-24 text-2xl font-bold text-gray-900 dark:text-white mb-4 text-center">Welcome to AliasVault</h2>- <p class="text-gray-600 dark:text-gray-400 mb-4 text-center">- AliasVault is a secure and private way to manage your online identities.+ <h2 class="mt-16 text-2xl font-bold text-gray-900 dark:text-white mb-4 text-center">Welcome to AliasVault</h2>+ <p class="text-gray-600 dark:text-gray-400 mb-8 text-center">+ AliasVault is a secure app which help you manage your online identities and passwords.Let's get you set up with your new vault.</p></div>diff --git a/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor b/src/AliasVault.Client/Auth/Pages/Setup/Setup.razorindex f665a177e..723630ef8 100644--- a/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor+++ b/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor@@ -13,7 +13,7 @@<div class="min-h-screen bg-gray-100 dark:bg-gray-900 flex items-center justify-center"><div class="w-full mx-auto lg:max-w-xl lg:bg-white lg:dark:bg-gray-800 lg:shadow-xl lg:rounded-lg lg:overflow-hidden"><div class="flex flex-col min-h-screen lg:min-h-0">- <div class="flex-grow p-8">+ <div class="flex-grow p-8 pb-0"><div class="flex justify-between items-center mb-4"><div><button @onclick="GoBack" class="text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 @(currentStep == SetupStep.Welcome ? "invisible" : "")">@@ -35,13 +35,10 @@<WelcomeStep />break;case SetupStep.Purpose:- <PurposeStep- Purpose="@setupData.Purpose"- OnPurposeChange="@((string purpose) => { setupData.Purpose = purpose; StateHasChanged(); })"- IsPurposeSelected="@(!string.IsNullOrWhiteSpace(setupData.Purpose))" />+ <TermsAndConditionsStep OnAgreedToTermsChanged="@HandleAgreedToTermsChanged" />break;case SetupStep.PurposeInstructions:- <PurposeInstructionsStep Purpose="@setupData.Purpose" />+ <PurposeInstructionsStep />break;case SetupStep.UserInfo:<UsernameStep@@ -85,7 +82,7 @@private bool isNextEnabled => currentStep switch{SetupStep.Welcome => true,- SetupStep.Purpose => !string.IsNullOrWhiteSpace(setupData.Purpose),+ SetupStep.Purpose => setupData.AgreedToTerms,SetupStep.PurposeInstructions => true,SetupStep.UserInfo => !string.IsNullOrWhiteSpace(setupData.Username),SetupStep.Password => !string.IsNullOrWhiteSpace(setupData.Password),@@ -193,6 +190,12 @@NavigationManager.NavigateTo("/");}+ private void HandleAgreedToTermsChanged(bool agreed)+ {+ setupData.AgreedToTerms = agreed;+ StateHasChanged();+ }+private enum SetupStep{Welcome,@@ -204,8 +207,26 @@private class SetupData{- public string Purpose { get; set; } = string.Empty;+ public bool AgreedToTerms { get; set; }public string Username { get; set; } = string.Empty;public string Password { get; set; } = string.Empty;}++ private string GetStepTitle(SetupStep step)+ {+ return step switch+ {+ SetupStep.Welcome => "Welcome",+ SetupStep.Purpose => "Terms and Conditions",+ SetupStep.PurposeInstructions => "Purpose Instructions",+ SetupStep.UserInfo => "Choose Username",+ SetupStep.Password => "Set Password",+ _ => "Setup"+ };+ }++ private int GetProgressPercentage()+ {+ return (int)currentStep * 100 / (Enum.GetValues(typeof(SetupStep)).Length - 1);+ }}diff --git a/src/AliasVault.Client/wwwroot/css/tailwind.css b/src/AliasVault.Client/wwwroot/css/tailwind.cssindex ec3df5e6c..18496de2d 100644--- a/src/AliasVault.Client/wwwroot/css/tailwind.css+++ b/src/AliasVault.Client/wwwroot/css/tailwind.css@@ -845,6 +845,10 @@ video {margin-top: -0.25rem;}+.mt-16 {+ margin-top: 4rem;+}+.line-clamp-2 {overflow: hidden;display: -webkit-box;@@ -932,6 +936,22 @@ video {height: 100%;}+.h-40 {+ height: 10rem;+}++.h-80 {+ height: 20rem;+}++.h-2 {+ height: 0.5rem;+}++.h-2\.5 {+ height: 0.625rem;+}+.min-h-screen {min-height: 100vh;}@@ -1669,6 +1689,10 @@ video {padding-top: 3.5rem;}+.pb-0 {+ padding-bottom: 0px;+}+.text-left {text-align: left;}