mirror of
https://github.com/kataras/iris.git
synced 2025-12-23 04:47:02 +00:00
add an example for sessions + view data as requested
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/kataras/iris/v12"
|
||||
@@ -62,14 +61,6 @@ func main() {
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
// generateID optionally to set the value for `jwt.ID` on Sign,
|
||||
// which sets the standard claims value "jti".
|
||||
// If you use a blocklist with the default Blocklist.GetKey you have to set it.
|
||||
var generateID = func(*context.Context) string {
|
||||
id, _ := uuid.NewRandom()
|
||||
return id.String()
|
||||
}
|
||||
|
||||
func authenticate(ctx iris.Context) {
|
||||
claims := userClaims{
|
||||
Username: "kataras",
|
||||
|
||||
Reference in New Issue
Block a user