2017-10-10 08:40:36 +00:00
|
|
|
package v1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2017-11-07 15:35:10 +00:00
|
|
|
"github.com/dgrijalva/jwt-go"
|
|
|
|
"github.com/labstack/echo"
|
2017-10-10 08:40:36 +00:00
|
|
|
)
|
|
|
|
|
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.
|
2017-10-10 08:40:36 +00:00
|
|
|
func CheckToken(c echo.Context) error {
|
|
|
|
|
2017-11-07 15:35:10 +00:00
|
|
|
user := c.Get("user").(*jwt.Token)
|
2017-10-10 08:40:36 +00:00
|
|
|
|
|
|
|
fmt.Println(user.Valid)
|
|
|
|
|
|
|
|
return nil
|
2017-11-07 15:35:10 +00:00
|
|
|
}
|