start setting up auth handler
This commit is contained in:
parent
82ac33ec66
commit
979a415b95
4 changed files with 62 additions and 0 deletions
16
internal/ctxkeys/ctx.go
Normal file
16
internal/ctxkeys/ctx.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package ctxkeys
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.juancwu.dev/juancwu/budgething/internal/model"
|
||||
)
|
||||
|
||||
const (
|
||||
UserKey string = "user"
|
||||
)
|
||||
|
||||
func User(ctx context.Context) *model.User {
|
||||
user, _ := ctx.Value(UserKey).(*model.User)
|
||||
return user
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue