Private
Public Access
fix+feat: añadido crear usuario y separado en componentes los modals
This commit is contained in:
1 parent
eff116fab0
commit
62ec25b768
14 files changed
+387
-131
No files matched your search
@@ -1,17 +1,17 @@
|
||||
package jwtutils
|
||||
|
||||
import (
|
||||
"repuestera_back/controllers/auth"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
var JWTSecret = []byte("supersecretkey123456789")
|
||||
|
||||
func ValidarJWT(tokenString string) (jwt.MapClaims, error) {
|
||||
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
|
||||
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
|
||||
return nil, jwt.ErrSignatureInvalid
|
||||
}
|
||||
return auth.JWTSecret, nil
|
||||
return JWTSecret, nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in new issue
Block a user