(parts: {
refreshToken: string
projectId?: string
managedProjectId?: string
})
| 1024 | } |
| 1025 | |
| 1026 | function formatRefreshParts(parts: { |
| 1027 | refreshToken: string |
| 1028 | projectId?: string |
| 1029 | managedProjectId?: string |
| 1030 | }): string { |
| 1031 | if (!parts.refreshToken) { |
| 1032 | return "" |
| 1033 | } |
| 1034 | if (!parts.projectId && !parts.managedProjectId) { |
| 1035 | return parts.refreshToken |
| 1036 | } |
| 1037 | const projectSegment = parts.projectId ?? "" |
| 1038 | const managedSegment = parts.managedProjectId ?? "" |
| 1039 | return `${parts.refreshToken}|${projectSegment}|${managedSegment}` |
| 1040 | } |
| 1041 | |
| 1042 | async function ensureGoogleAccessToken(auth: Extract<Auth.Info, { type: "oauth" }>, providerID: string): Promise<string> { |
| 1043 | const refreshParts = parseRefreshParts(auth.refresh) |
no outgoing calls
no test coverage detected