MCPcopy Create free account
hub / github.com/bytebase/bytebase / GetRefreshTokenFromCookie

Function GetRefreshTokenFromCookie

backend/api/auth/header.go:125–135  ·  view source on GitHub ↗

GetRefreshTokenFromCookie extracts the refresh token from request headers.

(header http.Header)

Source from the content-addressed store, hash-verified

123
124// GetRefreshTokenFromCookie extracts the refresh token from request headers.
125func GetRefreshTokenFromCookie(header http.Header) string {
126 for _, cookie := range header.Values("Cookie") {
127 for _, part := range strings.Split(cookie, ";") {
128 part = strings.TrimSpace(part)
129 if rt, ok := strings.CutPrefix(part, RefreshTokenCookieName+"="); ok {
130 return rt
131 }
132 }
133 }
134 return ""
135}

Callers 5

RefreshMethod · 0.92
DeleteWorkspaceMethod · 0.92
LeaveWorkspaceMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected