fix : 토큰 인증 수정
This commit is contained in:
@@ -8,7 +8,7 @@ namespace MMOserver.Api;
|
|||||||
|
|
||||||
public class RestApi : Singleton<RestApi>
|
public class RestApi : Singleton<RestApi>
|
||||||
{
|
{
|
||||||
private const string VERIFY_URL = "https://a301.api.tolelom.xyz/api/auth/verify";
|
private const string VERIFY_URL = "https://a301.api.tolelom.xyz/api/auth/internal/auth/verify";
|
||||||
private readonly HttpClient httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
private readonly HttpClient httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
|
||||||
|
|
||||||
private const int MAX_RETRY = 3;
|
private const int MAX_RETRY = 3;
|
||||||
@@ -24,6 +24,7 @@ public class RestApi : Singleton<RestApi>
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
HttpResponseMessage response = await httpClient.PostAsJsonAsync(VERIFY_URL, new { token });
|
HttpResponseMessage response = await httpClient.PostAsJsonAsync(VERIFY_URL, new { token });
|
||||||
|
response.Headers.Add("X-API-Key", token);
|
||||||
|
|
||||||
// 401: 토큰 자체가 무효 → 재시도해도 같은 결과, 즉시 반환
|
// 401: 토큰 자체가 무효 → 재시도해도 같은 결과, 즉시 반환
|
||||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
|
|||||||
Reference in New Issue
Block a user