MCPcopy Create free account
hub / github.com/kataras/iris / writeToken

Function writeToken

_examples/database/mysql/api/api.go:77–92  ·  view source on GitHub ↗
(signer *jwt.Signer)

Source from the content-addressed store, hash-verified

75}
76
77func 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}

Callers 1

RouterFunction · 0.70

Calls 4

GetFunction · 0.92
SignMethod · 0.80
StopWithStatusMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…