Compare commits
11 Commits
42f213e09d
...
8b0a0c6bc8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b0a0c6bc8 | ||
|
|
95e64b8431 | ||
|
|
574d0fb5ba | ||
|
|
5434f292c6 | ||
|
|
c4f6972aa2 | ||
|
|
4a3fb91ffe | ||
|
|
3673febe93 | ||
|
|
263bcc7649 | ||
|
|
3e935aa006 | ||
|
|
ee01415ebe | ||
|
|
69f0590e8d |
@ -19,19 +19,8 @@ namespace Core.Thalos.BFF.Api.Controllers
|
||||
public class AuthenticationController(
|
||||
IThalosServiceClient thalosServiceClient,
|
||||
ILogger<AuthenticationController> logger,
|
||||
ITokenService tokenService,
|
||||
IGoogleAuthorization googleAuthorization) : BaseController(logger)
|
||||
ITokenService tokenService) : BaseController(logger)
|
||||
{
|
||||
[HttpGet]
|
||||
public IActionResult Authorize() => Ok(googleAuthorization.GetAuthorizationUrl());
|
||||
|
||||
[HttpGet("callback")]
|
||||
public async Task<IActionResult> Callback(string code)
|
||||
{
|
||||
var userCredential = await googleAuthorization.ExchangeCodeForToken(code);
|
||||
|
||||
return Ok(new { Token = userCredential!.Token.IdToken });
|
||||
}
|
||||
/// <summary>
|
||||
/// Get token for user.
|
||||
/// </summary>
|
||||
|
||||
@ -75,6 +75,8 @@ namespace Core.Thalos.BFF.Api.Controllers
|
||||
|
||||
if (string.IsNullOrEmpty(newUser.RoleId)) return BadRequest("Invalid role id");
|
||||
|
||||
if (string.IsNullOrEmpty(newUser.TenantId)) return BadRequest("Invalid tenant id");
|
||||
|
||||
return await Handle(() => thalosServiceClient.CreateUserService(newUser, cancellationToken)).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -170,8 +172,6 @@ namespace Core.Thalos.BFF.Api.Controllers
|
||||
|
||||
if (string.IsNullOrEmpty(request.RoleId)) return BadRequest("Invalid role id");
|
||||
|
||||
if (!request.Companies.Any()) return BadRequest("The user must contain at least one company");
|
||||
|
||||
return await Handle(() => thalosServiceClient.UpdateUserService(request, cancellationToken)).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7239;http://localhost:5219",
|
||||
"applicationUrl": "https://localhost:44320;http://localhost:5219",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Local"
|
||||
}
|
||||
|
||||
@ -6,20 +6,20 @@
|
||||
}
|
||||
},
|
||||
"LocalGateways": {
|
||||
"ThalosService": "https://localhost:7253/api"
|
||||
"ThalosService": "https://localhost:44312/api"
|
||||
},
|
||||
"ServiceSettings": {
|
||||
"ApplicationName": "thalos",
|
||||
"LayerName": "bff"
|
||||
},
|
||||
"Vault": {
|
||||
"Address": "http://100.123.31.103:8200",
|
||||
"Token": "hvs.e37LQvLuPhTd5ALS5QQ03Cwm",
|
||||
"SecretMount": "secret"
|
||||
"Address": "https://vault.dream-views.com/:8200",
|
||||
"Token": "hvs.X11GqTbPzz4i5O4p6Mcduz7p",
|
||||
"SecretMount": "thalos"
|
||||
},
|
||||
"IdentityProviders": {
|
||||
"Google": true,
|
||||
"Azure": true
|
||||
"Azure": false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
public string? MiddleName { get; set; }
|
||||
public string LastName { get; set; } = null!;
|
||||
public string RoleId { get; set; } = null!;
|
||||
public string TenantId { get; set; } = null!;
|
||||
public bool SendInvitation { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@ namespace Core.Thalos.Application.UseCases.Users.Input
|
||||
public string? MiddleName { get; set; }
|
||||
public string LastName { get; set; } = null!;
|
||||
public string RoleId { get; set; } = null!;
|
||||
public string[] Companies { get; set; } = null!;
|
||||
public string[]? Projects { get; set; }
|
||||
public string TenantId { get; set; } = null!;
|
||||
|
||||
public StatusEnum Status { get; set; }
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.1.2" />
|
||||
<PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.1.8" />
|
||||
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" />
|
||||
<PackageReference Include="Refit" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user