mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 22:36:24 +01:00
fmt
parent
3ef4d7bdfd
commit
c68d801ee4
|
@ -27,15 +27,15 @@ import (
|
|||
)
|
||||
|
||||
func getTokenHandler(ctx iris.Context) {
|
||||
token := jwt.NewTokenWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"foo": "bar",
|
||||
})
|
||||
token := jwt.NewTokenWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"foo": "bar",
|
||||
})
|
||||
|
||||
// Sign and get the complete encoded token as a string using the secret
|
||||
tokenString, _ := token.SignedString([]byte("My Secret"))
|
||||
// Sign and get the complete encoded token as a string using the secret
|
||||
tokenString, _ := token.SignedString([]byte("My Secret"))
|
||||
|
||||
ctx.HTML(`Token: ` + tokenString + `<br/><br/>
|
||||
<a href="/secured?token=` + tokenString + `">/secured?token=` + tokenString + `</a>`)
|
||||
ctx.HTML(`Token: ` + tokenString + `<br/><br/>
|
||||
<a href="/secured?token=` + tokenString + `">/secured?token=` + tokenString + `</a>`)
|
||||
}
|
||||
|
||||
func myAuthenticatedHandler(ctx iris.Context) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user