xf 8 mesiacov pred
rodič
commit
39e1f47a2a

+ 17 - 0
src/Hotline.Api/Controllers/TestController.cs

@@ -669,6 +669,23 @@ ICallApplication callApplication,
         return DateTime.Now.ToString("O");
     }
 
+    [AllowAnonymous]
+    [HttpGet("t5")]
+    public async Task<string> GetUserAllowAnonymous()
+    {
+        var users = await _userRepository.Queryable()
+            .FirstAsync(d => d.Name == "xf", HttpContext.RequestAborted);
+        return users.Id;
+    }
+
+    [HttpGet("t6")]
+    public async Task<string> GetUserWithAuth()
+    {
+        var users = await _userRepository.Queryable()
+            .FirstAsync(d => d.Name == "xf", HttpContext.RequestAborted);
+        return users.Id;
+    }
+
     [HttpGet("rsa")]
     public async Task<string> Rsa()
     {