(signer *jwt.Signer)
| 75 | } |
| 76 | |
| 77 | func writeToken(signer *jwt.Signer) iris.Handler { |
| 78 | return func(ctx iris.Context) { |
| 79 | claims := jwt.Claims{ |
| 80 | Issuer: "https://iris-go.com", |
| 81 | Audience: []string{requestid.Get(ctx)}, |
| 82 | } |
| 83 | |
| 84 | token, err := signer.Sign(claims) |
| 85 | if err != nil { |
| 86 | ctx.StopWithStatus(iris.StatusInternalServerError) |
| 87 | return |
| 88 | } |
| 89 | |
| 90 | ctx.Write(token) |
| 91 | } |
| 92 | } |
no test coverage detected
searching dependent graphs…