Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97381b8b68 | ||
|
|
8ebb6d2370 | ||
|
|
eb8ba01159 |
@@ -2,11 +2,11 @@ name: Backend - Build & Lint
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main, pre-prod]
|
||||||
paths:
|
paths:
|
||||||
- "backend/**/**"
|
- "backend/**/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main, pre-prod]
|
||||||
paths:
|
paths:
|
||||||
- "backend/**/**"
|
- "backend/**/**"
|
||||||
|
|
||||||
|
|||||||
@@ -409,9 +409,9 @@ func GetClient2FAStatus(c *gin.Context) {
|
|||||||
settings, _ := database.GetSettings()
|
settings, _ := database.GetSettings()
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"two_fa_enabled": client.TwoFAEnabled,
|
"two_fa_enabled": client.TwoFAEnabled,
|
||||||
"telegram_linked": tgLinked,
|
"telegram_linked": tgLinked,
|
||||||
"admin_2fa_enabled": settings.Telegram2FAEnabled,
|
"admin_2fa_enabled": settings.Telegram2FAEnabled,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,7 +454,6 @@ func ToggleClient2FA(c *gin.Context) {
|
|||||||
c.JSON(http.StatusOK, gin.H{"success": true, "two_fa_enabled": req.Enabled})
|
c.JSON(http.StatusOK, gin.H{"success": true, "two_fa_enabled": req.Enabled})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChangePassword permet à un client de changer son mot de passe
|
|
||||||
func ChangePassword(c *gin.Context) {
|
func ChangePassword(c *gin.Context) {
|
||||||
var req struct {
|
var req struct {
|
||||||
CurrentPassword string `json:"current_password" binding:"required"`
|
CurrentPassword string `json:"current_password" binding:"required"`
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ type AdminClaims struct {
|
|||||||
jwt.RegisteredClaims
|
jwt.RegisteredClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================
|
|
||||||
// STRUCTURES REQUÊTE / RÉPONSE
|
|
||||||
// ============================================
|
|
||||||
|
|
||||||
type LoginRequest struct {
|
type LoginRequest struct {
|
||||||
Username string `json:"username" binding:"required"`
|
Username string `json:"username" binding:"required"`
|
||||||
Password string `json:"password" binding:"required"`
|
Password string `json:"password" binding:"required"`
|
||||||
|
|||||||
Reference in New Issue
Block a user