From 7efd5749a01375bbb83c37f4dfe30d04a1042140 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 25 Jun 2016 21:05:28 +0200 Subject: [PATCH] displays roles --- Yavsc/ApiController/AccountController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Yavsc/ApiController/AccountController.cs b/Yavsc/ApiController/AccountController.cs index 2f6e281f..26ae4101 100644 --- a/Yavsc/ApiController/AccountController.cs +++ b/Yavsc/ApiController/AccountController.cs @@ -129,7 +129,15 @@ namespace Yavsc.WebApi.Controllers if (uid == null) return new BadRequestObjectResult( new { error = "user not identified" }); - return Ok(new Me(await UserManager.FindByIdAsync(uid))); + + var iduser = await UserManager.FindByIdAsync(uid); + + var user = new Me(iduser.Id,iduser.UserName, + new stringĀ [] { iduser.Email }, + await UserManager.GetRolesAsync(iduser), + null // TODO better (an avatar, or Web site url) + ); + return Ok(user); } }