mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-08-18 22:37:15 +02:00
api: add encryption verifier
encryption verifier is used for verifying the encryption key during password resets. It can be any encrypted item.
This commit is contained in:
@@ -127,6 +127,24 @@ namespace Notesnook.API.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("verifier")]
|
||||
public async Task<IActionResult> GetEncryptionVerifier()
|
||||
{
|
||||
var userId = User.GetUserId();
|
||||
try
|
||||
{
|
||||
var response = await UserService.GetEncryptionVerifier(userId);
|
||||
if (response == null) return NotFound();
|
||||
return Ok(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "Failed to get encryption verifier for user id: {UserId}", userId);
|
||||
return BadRequest(new { error = ex.Message });
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost("reset")]
|
||||
public async Task<IActionResult> Reset([FromForm] bool removeAttachments)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user