Merge pull request #5880 from sbwalker/dev
improve new API method signatures
This commit is contained in:
@@ -291,12 +291,12 @@ namespace Oqtane.Services
|
|||||||
|
|
||||||
public async Task<bool> ForgotPasswordAsync(string username)
|
public async Task<bool> ForgotPasswordAsync(string username)
|
||||||
{
|
{
|
||||||
return await GetJsonAsync<bool>($"{Apiurl}/forgotpassword?name={username}");
|
return await GetJsonAsync<bool>($"{Apiurl}/forgotpassword/{WebUtility.UrlEncode(username)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> ForgotUsernameAsync(string email)
|
public async Task<bool> ForgotUsernameAsync(string email)
|
||||||
{
|
{
|
||||||
return await GetJsonAsync<bool>($"{Apiurl}/forgotusername?email={email}");
|
return await GetJsonAsync<bool>($"{Apiurl}/forgotusername/{WebUtility.UrlEncode(email)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<User> ResetPasswordAsync(User user, string token)
|
public async Task<User> ResetPasswordAsync(User user, string token)
|
||||||
@@ -388,7 +388,7 @@ namespace Oqtane.Services
|
|||||||
|
|
||||||
public async Task<bool> SendLoginLinkAsync(string email)
|
public async Task<bool> SendLoginLinkAsync(string email)
|
||||||
{
|
{
|
||||||
return await GetJsonAsync<bool>($"{Apiurl}/loginlink?email={email}");
|
return await GetJsonAsync<bool>($"{Apiurl}/loginlink/{WebUtility.UrlEncode(email)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Security.Policy;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Authentication;
|
using Microsoft.AspNetCore.Authentication;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
@@ -294,15 +293,15 @@ namespace Oqtane.Controllers
|
|||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/forgotpassword?name=x
|
// GET api/<controller>/forgotpassword/x
|
||||||
[HttpGet("forgotpassword")]
|
[HttpGet("forgotpassword/{username}")]
|
||||||
public async Task<bool> ForgotPassword(string name)
|
public async Task<bool> ForgotPassword(string username)
|
||||||
{
|
{
|
||||||
return await _userManager.ForgotPassword(name);
|
return await _userManager.ForgotPassword(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/forgotusername?email=x
|
// GET api/<controller>/forgotusername/x
|
||||||
[HttpGet("forgotusername")]
|
[HttpGet("forgotusername/{email}")]
|
||||||
public async Task<bool> ForgotUsername(string email)
|
public async Task<bool> ForgotUsername(string email)
|
||||||
{
|
{
|
||||||
return await _userManager.ForgotUsername(email);
|
return await _userManager.ForgotUsername(email);
|
||||||
@@ -564,8 +563,8 @@ namespace Oqtane.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET api/<controller>/loginlink?email=x
|
// GET api/<controller>/loginlink/x
|
||||||
[HttpGet("loginlink")]
|
[HttpGet("loginlink/{email}")]
|
||||||
public async Task<bool> SendLoginLink(string email)
|
public async Task<bool> SendLoginLink(string email)
|
||||||
{
|
{
|
||||||
return await _userManager.SendLoginLink(email);
|
return await _userManager.SendLoginLink(email);
|
||||||
|
|||||||
Reference in New Issue
Block a user