feat: automatic termination of older sessions on login (temporary until release 4);

fix: login controller method not returning tokens
This commit is contained in:
2025-07-06 14:45:36 +03:00
parent 8588a17928
commit 72a512bb4f
3 changed files with 23 additions and 8 deletions

View File

@@ -50,7 +50,6 @@ func NewAuthController(_log *zap.Logger, as services.AuthService) AuthController
return &authControllerImpl{log: _log, authService: as}
}
// Login implements AuthController.
// @Summary Acquire tokens via login credentials (and 2FA code if needed)
// @Tags Auth
// @Accept json
@@ -65,7 +64,7 @@ func (a *authControllerImpl) Login(c *gin.Context) {
return
}
_, err := a.authService.Login(request.Body)
response, err := a.authService.Login(request.Body)
if err != nil {
if errors.Is(err, errs.ErrForbidden) {
@@ -76,11 +75,10 @@ func (a *authControllerImpl) Login(c *gin.Context) {
return
}
c.Status(http.StatusOK)
c.JSON(http.StatusOK, response)
return
}
// PasswordResetBegin implements AuthController.
// @Summary Request password reset email
// @Tags Auth
// @Accept json
@@ -90,7 +88,6 @@ func (a *authControllerImpl) PasswordResetBegin(c *gin.Context) {
c.Status(http.StatusNotImplemented)
}
// PasswordResetComplete implements AuthController.
// @Summary Complete password reset with email code and provide 2FA code or backup code if needed
// @Tags Auth
// @Accept json
@@ -100,7 +97,6 @@ func (a *authControllerImpl) PasswordResetComplete(c *gin.Context) {
c.Status(http.StatusNotImplemented)
}
// Refresh implements AuthController.
// @Summary Receive new tokens via refresh token
// @Tags Auth
// @Accept json
@@ -110,7 +106,6 @@ func (a *authControllerImpl) Refresh(c *gin.Context) {
c.Status(http.StatusNotImplemented)
}
// RegistrationComplete implements AuthController.
// @Summary Register an account
// @Tags Auth
// @Accept json
@@ -142,7 +137,6 @@ func (a *authControllerImpl) RegistrationBegin(c *gin.Context) {
return
}
// RegistrationBegin implements AuthController.
// @Summary Confirm with code, finish creating the account
// @Tags Auth
// @Accept json