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