(input: {
readonly state: string;
readonly orgSlug?: string | null;
})
| 57 | * correct organization before completing the flow. |
| 58 | */ |
| 59 | export const encodeOAuthCallbackState = (input: { |
| 60 | readonly state: string; |
| 61 | readonly orgSlug?: string | null; |
| 62 | }): string => { |
| 63 | const orgSlug = input.orgSlug?.trim(); |
| 64 | if (!orgSlug) return input.state; |
| 65 | return Encoding.encodeBase64Url(encodeOAuthCallbackStateJson({ state: input.state, orgSlug })); |
| 66 | }; |
| 67 | |
| 68 | /** Decode a callback state value minted by `encodeOAuthCallbackState`. |
| 69 | * |
no outgoing calls
no test coverage detected