From d104c2ce93a1d61c5bd644dcac7cabce63baa895 Mon Sep 17 00:00:00 2001 From: Gervasio Marchand Date: Fri, 23 Dec 2022 09:01:33 -0300 Subject: [PATCH] Can't add a note before there's a token --- src/FakeRelay.Core/Helpers/ApiKeysHelper.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/FakeRelay.Core/Helpers/ApiKeysHelper.cs b/src/FakeRelay.Core/Helpers/ApiKeysHelper.cs index 7a12bf9..b6996ac 100644 --- a/src/FakeRelay.Core/Helpers/ApiKeysHelper.cs +++ b/src/FakeRelay.Core/Helpers/ApiKeysHelper.cs @@ -84,12 +84,14 @@ public static class ApiKeysHelper public static async Task AddTokenForHostAsync(string host, string? notes) { + var token = await AddTokenForHostAsync(host, await GetTokenToHostAsync()); + if (notes.HasValue()) { await UpdateNotesForHostAsync(host, notes); } - - return await AddTokenForHostAsync(host, await GetTokenToHostAsync()); + + return token; } public static async Task DeleteTokenForHostAsync(string host) @@ -125,4 +127,4 @@ public static class ApiKeysHelper return key; } -} \ No newline at end of file +}