| 160 | }; |
| 161 | |
| 162 | const providerErrorMessage = (params: OAuthCallbackUrlParams): PopupErrorMessage | null => { |
| 163 | const error = params.error ?? null; |
| 164 | const description = params.error_description ?? null; |
| 165 | const value = error ?? description; |
| 166 | if (!value) return null; |
| 167 | return { |
| 168 | short: "OAuth provider rejected authorization", |
| 169 | details: error && description && description !== error ? `${error}: ${description}` : value, |
| 170 | }; |
| 171 | }; |
| 172 | |
| 173 | /** |
| 174 | * Run a plugin's `completeOAuth` against URL params from the OAuth redirect, |