add Jwt authorization support for for API
This commit is contained in:
@ -104,5 +104,10 @@ namespace Oqtane.Services
|
||||
/// <returns></returns>
|
||||
Task<bool> ValidatePasswordAsync(string password);
|
||||
|
||||
/// <summary>
|
||||
/// Get token for current user
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<string> GetTokenAsync();
|
||||
}
|
||||
}
|
||||
|
@ -79,5 +79,10 @@ namespace Oqtane.Services
|
||||
{
|
||||
return await GetJsonAsync<bool>($"{Apiurl}/validate/{WebUtility.UrlEncode(password)}");
|
||||
}
|
||||
|
||||
public async Task<string> GetTokenAsync()
|
||||
{
|
||||
return await GetStringAsync($"{Apiurl}/token");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user