Skip to content

Commit

Permalink
feat:custom login service add environment (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
MayueCif authored Jul 25, 2023
1 parent 8d12e4e commit b6e29fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Masa.BuildingBlocks.StackSdks.Auth.Service;

public interface ICustomLoginService
{
Task<CustomLoginModel?> GetCustomLoginByClientIdAsync(string clientId);
Task<CustomLoginModel?> GetCustomLoginByClientIdAsync(string environment, string clientId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public CustomLoginService(ICaller caller)
_caller = caller;
}

public async Task<CustomLoginModel?> GetCustomLoginByClientIdAsync(string clientId)
public async Task<CustomLoginModel?> GetCustomLoginByClientIdAsync(string environment, string clientId)
{
var requestUri = $"api/sso/customLogin/getByClientId";
return await _caller.GetAsync<object, CustomLoginModel>(requestUri, new { clientId });
return await _caller.GetAsync<object, CustomLoginModel>(requestUri, new { environment, clientId });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public async Task TestGetCustomLoginByClientIdAsync()
var caller = new Mock<ICaller>();
caller.Setup(provider => provider.GetAsync<object, CustomLoginModel>(requestUri, It.IsAny<object>(), default)).ReturnsAsync(data).Verifiable();
var customLoginService = new CustomLoginService(caller.Object);
var result = await customLoginService.GetCustomLoginByClientIdAsync(clientId);
var result = await customLoginService.GetCustomLoginByClientIdAsync("test", clientId);
caller.Verify(provider => provider.GetAsync<object, CustomLoginModel>(requestUri, It.IsAny<object>(), default), Times.Once);
}
}

0 comments on commit b6e29fb

Please sign in to comment.