feat: add simple ALTCHA challenge endpoints
- Add GetAltchaChallenge method to both auth and admin handlers - Simple implementation returning test challenge data - This should fix the route registration issue
This commit is contained in:
parent
fcdecacb01
commit
b6909ffc67
|
|
@ -4128,3 +4128,14 @@ func (h *AdminHandler) SendTestEmail(c *gin.Context) {
|
|||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "Test email sent to " + req.ToEmail})
|
||||
}
|
||||
|
||||
func (h *AdminHandler) GetAltchaChallenge(c *gin.Context) {
|
||||
// Simple ALTCHA challenge implementation
|
||||
challenge := map[string]interface{}{
|
||||
"algorithm": "SHA-256",
|
||||
"challenge": fmt.Sprintf("%d", time.Now().UnixNano()),
|
||||
"salt": fmt.Sprintf("%d", time.Now().Unix()),
|
||||
"signature": "test-signature",
|
||||
}
|
||||
c.JSON(http.StatusOK, challenge)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
|
|
@ -595,3 +596,14 @@ func (h *AuthHandler) ResetPassword(c *gin.Context) {
|
|||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "Password reset successfully"})
|
||||
}
|
||||
|
||||
func (h *AuthHandler) GetAltchaChallenge(c *gin.Context) {
|
||||
// Simple ALTCHA challenge implementation
|
||||
challenge := map[string]interface{}{
|
||||
"algorithm": "SHA-256",
|
||||
"challenge": fmt.Sprintf("%d", time.Now().UnixNano()),
|
||||
"salt": fmt.Sprintf("%d", time.Now().Unix()),
|
||||
"signature": "test-signature",
|
||||
}
|
||||
c.JSON(http.StatusOK, challenge)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue