mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 14:18:12 +00:00
list all wallets for current user (WA-9)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"wallet-api/pkg/models"
|
||||
@@ -21,9 +20,11 @@ func Auth(c *gin.Context) {
|
||||
}
|
||||
token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) {
|
||||
_, ok := token.Method.(*jwt.SigningMethodHMAC)
|
||||
println(ok)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
||||
exceptionReturn.ErrorCode = "401001"
|
||||
exceptionReturn.StatusCode = 401
|
||||
exceptionReturn.Message = "Invalid token"
|
||||
c.AbortWithStatusJSON(exceptionReturn.StatusCode, exceptionReturn)
|
||||
}
|
||||
return []byte(secret), nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user