Release v1.0.0 #16
.envDbInitializer.csDependencyInjection.csnuget.config
.gitea/workflows
.gitignoreApiDto
ApiDto.csproj
Backend.slnDockerfileCommon
Requests
Responses
Endpoint
Backend.httpISaveSettings.cs
README.mdCommon
Attributes
BadRequestResponseAttribute.csCacheMaxAgeAttribute.csLocalhostAttribute.csMaintenanceModeIgnoreAttribute.csNotFoundResponseAttribute.csSwaggerDefaultAttribute.csTokenAuthenticationAttribute.cs
Exceptions
Interfaces
MapperDto
Services
Configuration
Core
BackgroundTasks
Middleware
CacheMaxAgeMiddleware.csCookieAuthorizationMiddleware.csCustomExceptionHandlerMiddleware.csJwtRevocationMiddleware.csMaintenanceModeMiddleware.cs
Startup
Model
SwaggerOptions
Validation
Controllers
BaseController.cs
Endpoint.csprojProgram.csConfiguration
V1
AuthController.csCampusController.csDisciplineController.csFacultyController.csGroupController.csImportController.csLectureHallController.csProfessorController.csScheduleController.cs
WeatherForecastController.csSync
WeatherForecast.cswwwroot
css
swagger
Security
Common
CookieNames.cs
DependencyInjection.csDomain
Caching
CookieOptionsParameters.csOAuth2
OAuthProvider.csOAuthUser.csRequestContextInfo.csTwoFactorAuthenticator.csUser.csInterfaces
Properties
Security.csprojServices
SqlData
Application
Application.csprojDependencyInjection.cs
Common
Cqrs
Campus
Queries
Discipline
Queries
Faculty
Queries
Group
Queries
LectureHall
Queries
Professor
Queries
GetProfessorDetails
GetProfessorDetailsBySearch
GetProfessorList
Schedule
Interfaces
Domain
Domain.csproj
Schedule
Migrations
MysqlMigrations
Migrations
20240601023106_InitialMigration.Designer.cs20240601023106_InitialMigration.cs20241027034820_RemoveUnusedRef.Designer.cs20241027034820_RemoveUnusedRef.csUberDbContextModelSnapshot.cs
MysqlMigrations.csprojPsqlMigrations
Migrations
20240601021702_InitialMigration.Designer.cs20240601021702_InitialMigration.cs20241027032753_RemoveUnusedRef.Designer.cs20241027032753_RemoveUnusedRef.csUberDbContextModelSnapshot.cs
PsqlMigrations.csprojSqliteMigrations
Persistence
Common
BaseDbContext.csConfigurationResolver.csDatabaseProvider.csDbContextFactory.csModelBuilderExtensions.cs
Contexts
Schedule
EntityTypeConfigurations
Persistence.csprojUberDbContext.cs@@ -29,12 +29,21 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
||||
Path = UrlHelper.GetSubPathWithoutFirstApiName + "api"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of available OAuth providers with their respective redirect URIs.
|
||||
/// </summary>
|
||||
/// <returns>A list of available providers.</returns>
|
||||
[HttpGet("GetAvailableProviders")]
|
||||
public ActionResult<List<AvailableProvidersResponse>> GetUrls() =>
|
||||
Ok(oAuthService
|
||||
.GetAvailableProviders(HttpContext, GetCookieParams(), HttpContext.GetApiUrl(Url.Action("OAuth2")!))
|
||||
.ConvertToDto());
|
||||
|
||||
/// <summary>
|
||||
/// Logs in a user using their username or email and password.
|
||||
/// </summary>
|
||||
/// <param name="request">The login request containing username/email and password.</param>
|
||||
/// <returns>A TwoFactorAuthentication token if the login is successful; otherwise, a BadRequest response.</returns>
|
||||
[HttpPost("Login")]
|
||||
[BadRequestResponse]
|
||||
public async Task<ActionResult<TwoFactorAuthentication>> Login([FromBody] LoginRequest request)
|
||||
@@ -63,6 +72,11 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
||||
return Ok(tokenResult.ConvertToDto());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs two-factor authentication for the user.
|
||||
/// </summary>
|
||||
/// <param name="request">The request containing the method and code for two-factor authentication.</param>
|
||||
/// <returns>A boolean indicating whether the two-factor authentication was successful.</returns>
|
||||
[HttpPost("2FA")]
|
||||
[BadRequestResponse]
|
||||
public async Task<ActionResult<bool>> TwoFactorAuth([FromBody] TwoFactorAuthRequest request)
|
||||
|
Reference in New Issue
Block a user