Remove BTCPay completely, integrate SilverPAY only, configure TeleBot with real token
- Removed all BTCPay references from services and configuration - Implemented SilverPAY as sole payment provider (no fallback) - Fixed JWT authentication with proper key length (256+ bits) - Added UsersController with full CRUD operations - Updated User model with Email and Role properties - Configured TeleBot with real Telegram bot token - Fixed launchSettings.json with JWT environment variable - E2E tests passing for authentication, catalog, orders - Payment creation pending SilverPAY server fix 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,22 +9,36 @@ namespace LittleShop.Controllers;
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
private readonly IAuthService _authService;
|
||||
private readonly ILogger<AuthController> _logger;
|
||||
|
||||
public AuthController(IAuthService authService)
|
||||
public AuthController(IAuthService authService, ILogger<AuthController> logger)
|
||||
{
|
||||
_authService = authService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpPost("login")]
|
||||
public async Task<ActionResult<AuthResponseDto>> Login([FromBody] LoginDto loginDto)
|
||||
{
|
||||
var result = await _authService.LoginAsync(loginDto);
|
||||
|
||||
if (result != null)
|
||||
try
|
||||
{
|
||||
return Ok(result);
|
||||
_logger.LogInformation("Login attempt for user: {Username}", loginDto.Username);
|
||||
|
||||
var result = await _authService.LoginAsync(loginDto);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
_logger.LogInformation("Login successful for user: {Username}", loginDto.Username);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
_logger.LogWarning("Login failed for user: {Username}", loginDto.Username);
|
||||
return Unauthorized(new { message = "Invalid credentials" });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error during login for user: {Username}", loginDto.Username);
|
||||
return StatusCode(500, new { message = "An error occurred during login", error = ex.Message });
|
||||
}
|
||||
|
||||
return Unauthorized(new { message = "Invalid credentials" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user