mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
global: minor refactoring
This commit is contained in:
@@ -78,6 +78,8 @@ namespace Notesnook.API.Controllers
|
||||
|
||||
if (user.AttachmentsKey != null)
|
||||
await UserService.SetUserAttachmentsKeyAsync(response.UserId, user.AttachmentsKey);
|
||||
else if (user.Profile != null)
|
||||
await UserService.SetUserProfileAsync(response.UserId, user.Profile);
|
||||
else return BadRequest();
|
||||
|
||||
return Ok();
|
||||
@@ -102,7 +104,7 @@ namespace Notesnook.API.Controllers
|
||||
|
||||
if (await UserService.DeleteUserAsync(userId, User.FindFirstValue("jti")))
|
||||
{
|
||||
Response response = await this.httpClient.ForwardAsync<Response>(this.HttpContextAccessor, $"{Servers.IdentityServer.ToString()}/account/unregister", HttpMethod.Post);
|
||||
Response response = await this.httpClient.ForwardAsync<Response>(HttpContextAccessor, $"{Servers.IdentityServer}/account/unregister", HttpMethod.Post);
|
||||
if (!response.Success) return BadRequest();
|
||||
|
||||
return Ok();
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Streetwriters.Data.DbContexts
|
||||
using (IClientSessionHandle session = await MongoClient.StartSessionAsync())
|
||||
{
|
||||
#if DEBUG
|
||||
await Task.WhenAll(_commands.Select(c => c(session, default(CancellationToken))));
|
||||
await Task.WhenAll(_commands.Select(c => c(session, default)));
|
||||
#else
|
||||
await session.WithTransactionAsync(async (handle, token) =>
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Streetwriters.Identity.Services
|
||||
public class EmailAddressValidator
|
||||
{
|
||||
private static DateTimeOffset LAST_FETCH_TIME = DateTimeOffset.MinValue;
|
||||
private static HashSet<string> BLACKLISTED_DOMAINS = new HashSet<string>();
|
||||
private static HashSet<string> BLACKLISTED_DOMAINS = new();
|
||||
|
||||
public static async Task<bool> IsEmailAddressValidAsync(string email)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user