1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00

Merge pull request #1662 from kataras/jwt-new-features

New JWT Middleware features and more
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-11-06 11:42:35 +02:00
committed by GitHub
61 changed files with 2928 additions and 1409 deletions

View File

@@ -170,9 +170,23 @@ var BuiltinDependencies = []*Dependency{
NewDependency(func(ctx *context.Context) Code {
return Code(ctx.GetStatusCode())
}).Explicitly(),
// Context Error. May be nil
NewDependency(func(ctx *context.Context) Err {
return Err(ctx.GetErr())
err := ctx.GetErr()
if err == nil {
return nil
}
return err
}).Explicitly(),
// Context User, e.g. from basic authentication.
NewDependency(func(ctx *context.Context) context.User {
u := ctx.User()
if u == nil {
return nil
}
return u
}),
// payload and param bindings are dynamically allocated and declared at the end of the `binding` source file.
}