This commit is contained in:
@@ -36,7 +36,8 @@ func TokenValid(c *gin.Context) error {
|
|||||||
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
|
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
|
||||||
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
||||||
}
|
}
|
||||||
return []byte(os.Getenv("API_SECRET")), nil
|
//return []byte(os.Getenv("API_SECRET")), nil
|
||||||
|
return []byte(""), nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -64,7 +65,8 @@ func ExtractTokenID(c *gin.Context) (uint, error) {
|
|||||||
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
||||||
}
|
}
|
||||||
// Why return the secret??
|
// Why return the secret??
|
||||||
return []byte(os.Getenv("API_SECRET")), nil
|
//return []byte(os.Getenv("API_SECRET")), nil
|
||||||
|
return 0, nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
Reference in New Issue
Block a user