diff options
| author | chrislu <chris.lu@gmail.com> | 2023-12-07 08:13:46 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-12-07 08:13:46 -0800 |
| commit | c1a6e624e55a5b5dd57a21d02a6e91bb8a938dab (patch) | |
| tree | 900ebfcd39f7eec21dde5b94d77754157f733253 /weed/security/jwt.go | |
| parent | 5fe4c04a1a629d3d32b1d639cb28f9df4c7ae697 (diff) | |
| parent | 43a5973a66052e63a2bcb609d198481ea508ca80 (diff) | |
| download | seaweedfs-c1a6e624e55a5b5dd57a21d02a6e91bb8a938dab.tar.xz seaweedfs-c1a6e624e55a5b5dd57a21d02a6e91bb8a938dab.zip | |
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs
Diffstat (limited to 'weed/security/jwt.go')
| -rw-r--r-- | weed/security/jwt.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/weed/security/jwt.go b/weed/security/jwt.go index 446c3c21d..d859e9ea8 100644 --- a/weed/security/jwt.go +++ b/weed/security/jwt.go @@ -83,6 +83,14 @@ func GetJwt(r *http.Request) EncodedJwt { } } + // Get token from http only cookie + if tokenStr == "" { + token, err := r.Cookie("AT") + if err == nil { + tokenStr = token.Value + } + } + return EncodedJwt(tokenStr) } |
