mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-01-25 06:17:48 -05:00
29 lines
1016 B
Plaintext
29 lines
1016 B
Plaintext
@inject DbService DbService
|
|
@inject AuthService AuthService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<div class="ms-2 items-center hidden lg:flex">
|
|
<button class="p-2 hover:bg-gray-200 rounded-2xl" @onclick="OnLockClick" title="Lock vault">
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-gray-400" viewBox="0 0 20 20" fill="currentColor">
|
|
<path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
@code {
|
|
/// <summary>
|
|
/// Lock the database.
|
|
/// </summary>
|
|
private void OnLockClick()
|
|
{
|
|
// Remove encryption key.
|
|
AuthService.RemoveEncryptionKey();
|
|
|
|
// Initialize empty database which removes unencrypted data.
|
|
DbService.InitializeEmptyDatabase();
|
|
|
|
// Redirect to unlock page with SkipWebAuthn parameter set to true.
|
|
NavigationManager.NavigateTo("/unlock/true");
|
|
}
|
|
}
|