Library/routes/api/v1/token_check.go

18 lines
319 B
Go
Raw Normal View History

package v1
import (
"fmt"
2017-11-07 15:35:10 +00:00
"github.com/dgrijalva/jwt-go"
"github.com/labstack/echo"
)
2017-11-08 09:55:17 +00:00
// CheckToken checks prints a message if the token is valid or not. Currently only used for testing pourposes.
func CheckToken(c echo.Context) error {
2017-11-07 15:35:10 +00:00
user := c.Get("user").(*jwt.Token)
fmt.Println(user.Valid)
return nil
2017-11-07 15:35:10 +00:00
}