chore: build
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
# Expo local state (in sub-projects)
|
# Expo local state (in sub-projects)
|
||||||
**/.expo/
|
**/.expo/
|
||||||
test_address.sh
|
|
||||||
easpip
|
easpip
|
||||||
ansible/
|
ansible/
|
||||||
dist/
|
dist/
|
||||||
frontend-prep2/
|
|
||||||
scripts/data.txt
|
|
||||||
scripts/data2.txt
|
|
||||||
scripts/data3.txt
|
|
||||||
|
|||||||
@@ -287,15 +287,18 @@ func LoginClient(c *gin.Context) {
|
|||||||
if linked {
|
if linked {
|
||||||
code := fmt.Sprintf("%06d", cryptoRandInt()%1000000)
|
code := fmt.Sprintf("%06d", cryptoRandInt()%1000000)
|
||||||
sessionToken := uuid.New().String()
|
sessionToken := uuid.New().String()
|
||||||
if err := db.Store2FASession(sessionToken, client.Username, code); err == nil {
|
if err := db.Store2FASession(sessionToken, client.Username, code); err != nil {
|
||||||
msg := fmt.Sprintf("🔐 Code de vérification : <b>%s</b>\n\nValable 5 minutes.", code)
|
log.Printf("❌ [2FA] Erreur stockage session Redis: %v", err)
|
||||||
services.TelegramBot.SendMessage(chatID, msg)
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "Erreur interne"})
|
||||||
c.JSON(http.StatusOK, gin.H{
|
|
||||||
"requires_2fa": true,
|
|
||||||
"session_token": sessionToken,
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
msg := fmt.Sprintf("🔐 Code de vérification : <b>%s</b>\n\nValable 5 minutes.", code)
|
||||||
|
services.TelegramBot.SendMessage(chatID, msg)
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"requires_2fa": true,
|
||||||
|
"session_token": sessionToken,
|
||||||
|
})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user