fixe l'impact OAuth sheme
This commit is contained in:
parent
fb1eaee20d
commit
494a840f70
4 changed files with 38 additions and 30 deletions
|
|
@ -118,5 +118,22 @@ namespace Yavsc.WebApi.Controllers
|
|||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
[HttpGet("~/api/me"),Produces("application/json")]
|
||||
public async Task<IActionResult> Me ()
|
||||
{
|
||||
|
||||
if (User==null) return new BadRequestObjectResult(
|
||||
new {
|
||||
error = "no user"
|
||||
});
|
||||
var uid = User.GetUserId();
|
||||
if (uid == null)
|
||||
return new BadRequestObjectResult(
|
||||
new {
|
||||
error = "not identified"
|
||||
});
|
||||
return Ok(await UserManager.FindByIdAsync(uid));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue