(state: string | null)
| 41 | callbackPath: payload.callbackPath, |
| 42 | githubAppType: payload.githubAppType, |
| 43 | platformIntegrationId: payload.platformIntegrationId as string | undefined, |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | export function createGitHubBotLinkState( |
| 48 | userId: string, |
| 49 | installationId: string, |
| 50 | callbackPath = '/github/link', |
| 51 | githubAppType?: 'standard' | 'lite', |
| 52 | platformIntegrationId?: string |
| 53 | ): string { |
| 54 | return createSignedToken({ |
| 55 | userId, |
| 56 | installationId, |
| 57 | callbackPath, |
| 58 | githubAppType, |
| 59 | platformIntegrationId, |
| 60 | }); |
| 61 | } |
| 62 | |
| 63 | export function verifyGitHubBotLinkState(state: string | null): VerifiedGitHubBotLinkState | null { |
| 64 | return verifySignedToken(state, { |
| 65 | ttlSeconds: STATE_TTL_SECONDS, |
| 66 | parse: parseGitHubBotLinkState, |
| 67 | }); |
| 68 | } |
no test coverage detected