1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 03:47:04 +00:00

add context partial user helper and accept a generic interface on SetUser - the same method now returns an error if the given value does not complete at least one method of the User interface

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-10-31 15:47:28 +02:00
parent 8eea0296a7
commit 3d59d19de6
8 changed files with 356 additions and 191 deletions

View File

@@ -56,7 +56,9 @@ func h(ctx iris.Context) {
// makes sure for that, otherwise this handler will not be executed.
// OR:
user := ctx.User()
ctx.Writef("%s %s:%s", ctx.Path(), user.GetUsername(), user.GetPassword())
username, _ := user.GetUsername()
password, _ := user.GetPassword
ctx.Writef("%s %s:%s", ctx.Path(), username, password)
}
func logout(ctx iris.Context) {