Open lixh00 opened 2 years ago
Yes you can!
manager := maange.NewDefaultManager()
server := server.NewDefaultServer(manager)
server.SetUserAuthorizationHandler(func(rw http.ResponseWriter, r *http.Request) (string, error) {
var (
ctx = r.Context()
username = r.FormValue("username")
password = r.FormValue("password")
)
user, err := myAuthenticator.Authenticate(ctx, username, password)
// handle error
// update last login time in DB
})
Can I add a callback after login? such as updating the last login time of the database after login.