Fixes api/setavatar
This commit is contained in:
parent
0195c9a380
commit
91cc9c43b2
1 changed files with 6 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
using Yavsc.Helpers;
|
using Yavsc.Helpers;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
[Authorize("AdministratorOnly"),Route("~/api/account"),Obsolete]
|
[Authorize(),Route("~/api/account"),Obsolete]
|
||||||
public class ApiAccountController : Controller
|
public class ApiAccountController : Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -44,6 +44,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST api/Account/ChangePassword
|
// POST api/Account/ChangePassword
|
||||||
|
[Authorize]
|
||||||
public async Task<IActionResult> ChangePassword(ChangePasswordBindingModel model)
|
public async Task<IActionResult> ChangePassword(ChangePasswordBindingModel model)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
|
|
@ -65,6 +66,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST api/Account/SetPassword
|
// POST api/Account/SetPassword
|
||||||
|
[Authorize]
|
||||||
public async Task<IActionResult> SetPassword(SetPasswordBindingModel model)
|
public async Task<IActionResult> SetPassword(SetPasswordBindingModel model)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
|
|
@ -121,7 +123,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("~/api/me")]
|
[HttpGet("~/api/me"),Authorize]
|
||||||
public async Task<IActionResult> Me ()
|
public async Task<IActionResult> Me ()
|
||||||
{
|
{
|
||||||
if (User==null)
|
if (User==null)
|
||||||
|
|
@ -144,7 +146,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="me">MyUpdate containing the new user name </param>
|
/// <param name="me">MyUpdate containing the new user name </param>
|
||||||
/// <returns>Ok when all is ok.</returns>
|
/// <returns>Ok when all is ok.</returns>
|
||||||
[HttpPut("~/api/me")]
|
[HttpPut("~/api/me"),Authorize]
|
||||||
public async Task<IActionResult> UpdateMe(UserInfo me)
|
public async Task<IActionResult> UpdateMe(UserInfo me)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid) return new BadRequestObjectResult(
|
if (!ModelState.IsValid) return new BadRequestObjectResult(
|
||||||
|
|
@ -159,7 +161,7 @@ namespace Yavsc.WebApi.Controllers
|
||||||
/// Updates the avatar
|
/// Updates the avatar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("~/api/setavatar")]
|
[HttpPost("~/api/setavatar"),Authorize]
|
||||||
public async Task<IActionResult> SetAvatar()
|
public async Task<IActionResult> SetAvatar()
|
||||||
{
|
{
|
||||||
var root = User.InitPostToFileSystem(null);
|
var root = User.InitPostToFileSystem(null);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue