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

New JWT features and changes (examples updated). Improvements on the Context User and Private Error features

TODO: Write the new e-book JWT section and the HISTORY entry of the chnages and  add a simple example on site docs
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-10-17 06:40:17 +03:00
parent b816156e77
commit 1864f99145
19 changed files with 1749 additions and 493 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.
}