File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ app.*.map.json
4545/android /app /profile
4646/android /app /release
4747
48-
48+ # ignore data dir
49+ data /
4950
5051# ignore build outputs
5152bin /
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "context"
45 "fmt"
56 "log"
67 "net/http"
@@ -65,7 +66,19 @@ func main() {
6566 CookieDuration : time .Hour * 24 , // cookie expires in 1 day and will enforce re-login
6667 Issuer : "ferna" ,
6768 URL : baseUrl ,
68- AvatarStore : avatar .NewLocalFS ("/tmp" ),
69+ DisableXSRF : true ,
70+ ClaimsUpd : token .ClaimsUpdFunc (func (cl token.Claims ) token.Claims {
71+ if cl .User .Name == "" {
72+ return cl
73+ }
74+ u , err := database .GetUserByEmail (context .TODO (), cl .User .Name )
75+ if err != nil || u == nil {
76+ return cl
77+ }
78+ cl .User .SetStrAttr ("uid" , fmt .Sprint (u .ID ))
79+ return cl
80+ }),
81+ AvatarStore : avatar .NewLocalFS ("/tmp" ),
6982 }
7083
7184 // create auth service with providers
You can’t perform that action at this time.
0 commit comments