ADD:added decode jwt token and automated login to dashboard after login

This commit is contained in:
hwinkel
2025-05-21 20:12:50 +02:00
parent a330291456
commit 4158b87576
6 changed files with 44 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ func LoginHandler(c *gin.Context) {
}
// Systemnutzer
if req.Email == "systemuser@example.com" {
if req.Email == "test@localhost.de" {
token, err := CreateJWT("system-user-id", req.Email, "admin", time.Hour*24*7)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Token error"})