( value: string | null | undefined, )
| 71 | * the raw OAuth state unchanged. |
| 72 | */ |
| 73 | export const decodeOAuthCallbackState = ( |
| 74 | value: string | null | undefined, |
| 75 | ): OAuthCallbackState | null => { |
| 76 | if (!value) return null; |
| 77 | const json = Result.getOrNull(Encoding.decodeBase64UrlString(value)); |
| 78 | if (json === null) return null; |
| 79 | const decoded = Option.getOrNull(decodeOAuthCallbackStateJson(json)); |
| 80 | if (decoded === null) return null; |
| 81 | const orgSlug = decoded.orgSlug.trim(); |
| 82 | return orgSlug ? { state: decoded.state, orgSlug } : null; |
| 83 | }; |
no outgoing calls
no test coverage detected