DeutschLernen/GermanApp/Application/Interfaces/IAuthService.cs
Lasse Rune Hansen d508d498c0 feat(backend/auth): implement User Authentication feature
- Add DTOs: RegisterDto, LoginDto, AuthResponse
- Add IAuthService interface
- Implement AuthService with JWT token generation
- Create AuthController with register, login, me endpoints
- Add JWT configuration to appsettings.json
- Configure JWT Bearer authentication in Program.cs
- Add PasswordHasher for custom User entity
- Update User entity with ChangePassword method
- Add necessary NuGet packages for JWT auth

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 13:27:43 +02:00

32 lines
1,017 B
C#

using GermanApp.Application.DTOs.Auth;
using GermanApp.Domain.Entities;
namespace GermanApp.Application.Interfaces;
/// <summary>
/// Interface for authentication services.
/// Part of the Application layer.
/// </summary>
public interface IAuthService
{
/// <summary>
/// Registers a new user.
/// </summary>
/// <param name="registerDto">User registration data</param>
/// <returns>Authentication response with token</returns>
Task<AuthResponse> RegisterAsync(RegisterDto registerDto);
/// <summary>
/// Authenticates a user and returns a JWT token.
/// </summary>
/// <param name="loginDto">User login data</param>
/// <returns>Authentication response with token</returns>
Task<AuthResponse> LoginAsync(LoginDto loginDto);
/// <summary>
/// Gets the current authenticated user.
/// </summary>
/// <param name="userId">User ID from token claims</param>
/// <returns>The user entity</returns>
Task<User?> GetCurrentUserAsync(int userId);
}