mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 04:47:02 +00:00
update deps
This commit is contained in:
@@ -69,6 +69,7 @@ func handler(ctx iris.Context) {
|
||||
// makes sure for that, otherwise this handler will not be executed.
|
||||
// OR:
|
||||
user := ctx.User()
|
||||
// OR ctx.User().GetRaw() to get the underline value.
|
||||
username, _ := user.GetUsername()
|
||||
password, _ := user.GetPassword()
|
||||
ctx.Writef("%s %s:%s", ctx.Path(), username, password)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package main
|
||||
package main // Look README.md
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -65,7 +65,8 @@ func main() {
|
||||
}
|
||||
|
||||
func index(ctx iris.Context) {
|
||||
user := ctx.User()
|
||||
user, _ := ctx.User().GetRaw()
|
||||
// user is a type of main.User
|
||||
ctx.JSON(user)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user