aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Authentication
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-25 18:36:02 +0800
committer杨宇千 <crupest@outlook.com>2019-10-25 18:36:02 +0800
commit5790142f81f2a94ad073834b1534acbf9b02ea3c (patch)
treec6ec0a916c78a02b36113fb62f0e919019df6cfc /Timeline/Authentication
parent681e2cc9ecaeefd883a7c6645374926c184fba5d (diff)
downloadtimeline-5790142f81f2a94ad073834b1534acbf9b02ea3c.tar.gz
timeline-5790142f81f2a94ad073834b1534acbf9b02ea3c.tar.bz2
timeline-5790142f81f2a94ad073834b1534acbf9b02ea3c.zip
Add NeutralResourcesLanguage. Conform to best practices.
Diffstat (limited to 'Timeline/Authentication')
-rw-r--r--Timeline/Authentication/AuthHandler.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Timeline/Authentication/AuthHandler.cs b/Timeline/Authentication/AuthHandler.cs
index 602a44db..2b457eb1 100644
--- a/Timeline/Authentication/AuthHandler.cs
+++ b/Timeline/Authentication/AuthHandler.cs
@@ -9,6 +9,7 @@ using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Timeline.Models;
using Timeline.Services;
+using static Timeline.Resources.Authentication.AuthHandler;
namespace Timeline.Authentication
{
@@ -46,7 +47,7 @@ namespace Timeline.Authentication
if (!string.IsNullOrEmpty(header) && header.StartsWith("Bearer ", StringComparison.InvariantCultureIgnoreCase))
{
var token = header.Substring("Bearer ".Length).Trim();
- _logger.LogInformation(Resources.Authentication.AuthHandler.LogTokenFoundInHeader, token);
+ _logger.LogInformation(LogTokenFoundInHeader, token);
return token;
}
@@ -57,7 +58,7 @@ namespace Timeline.Authentication
string token = Request.Query[paramQueryKey];
if (!string.IsNullOrEmpty(token))
{
- _logger.LogInformation(Resources.Authentication.AuthHandler.LogTokenFoundInQuery, paramQueryKey, token);
+ _logger.LogInformation(LogTokenFoundInQuery, paramQueryKey, token);
return token;
}
}
@@ -71,7 +72,7 @@ namespace Timeline.Authentication
var token = ExtractToken();
if (string.IsNullOrEmpty(token))
{
- _logger.LogInformation(Resources.Authentication.AuthHandler.LogTokenNotFound);
+ _logger.LogInformation(LogTokenNotFound);
return AuthenticateResult.NoResult();
}
@@ -90,7 +91,7 @@ namespace Timeline.Authentication
}
catch (Exception e) when (!(e is ArgumentException))
{
- _logger.LogInformation(e, Resources.Authentication.AuthHandler.LogTokenValidationFail);
+ _logger.LogInformation(e, LogTokenValidationFail);
return AuthenticateResult.Fail(e);
}
}