Sergey

Results 23 comments of Sergey

@fproulx-eoscanada middlewares: ``` func authorizeMiddleware(next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { ctx := context.WithValue(r.Context(), "user_id", "user-12345") next(w, r.WithContext(ctx)) } } func limiterMiddleware(rateLimiter *redis_rate.Limiter, limit int64, next http.HandlerFunc)...

There is two variants how to add Funcs: - AddFromFilesFuncs; - AddFromStringsFuncs. Lets use `.../multitemplate/example/advanced/example.go:45` as base: ``` r.AddFromFiles(filepath.Base(include), files...) ``` AddFromFilesFuncs: ``` r.AddFromFilesFuncs(filepath.Base(include), template.FuncMap{}, files...) ``` AddFromStringsFuncs: ``` r.AddFromStringsFuncs("tmpl-name",...

@asbjornu `AddFromFilesFuncs`, `AddFromStringsFuncs` uses Go's package `html/template` functionality of Template creation and extension. [AddFromStringsFuncs:](https://github.com/gin-contrib/multitemplate/blob/master/multitemplate.go#L61) ```go tmpl := template.New(name).Funcs(funcMap) ```

You can find example of how to use QOR at: https://github.com/qor/qor-example Example of `User`'s model: https://github.com/qor/qor-example/blob/debf77110d7a9eeea6835234a100e73fc699503a/models/users/user.go#L11

Documentation and examples: https://doc.getqor.com Project example: https://github.com/qor/qor-example

@x0rzkov out of box qor admin is not compatible with go modules. The error occurred because template was not found. https://github.com/qor/auth/issues/23#issuecomment-569522292 Accordingly to https://doc.getqor.com simples solution is to compile templates...

@x0rzkov just follow https://doc.getqor.com/guides/bindatafs.html and dive into source code repo: https://github.com/sergolius/qor_bindatafs_example I tried to commit step by step

@x0rzkov `auth` module partly supports JWT authentication: https://github.com/qor/auth/blob/11d4c974507d28e2fd10ff94edcdd00369e069a6/session_storer.go#L43 You can wrap `SessionStorer` with decorator to extend behaviour of `Update` method https://github.com/qor/auth/blob/11d4c974507d28e2fd10ff94edcdd00369e069a6/session_storer.go#L54 To make set "Authorization" header in response

@x0rzkov QOR is very flexible, it's up to you to extend or override functionality. See Password provider as base example: https://github.com/qor/auth/blob/11d4c974507d28e2fd10ff94edcdd00369e069a6/providers/password/password.go

Please see https://github.com/qor/auth/issues/12#issuecomment-524820403