| 171 | }; |
| 172 | |
| 173 | const providerErrorMessage = (params: OAuthCallbackUrlParams): PopupErrorMessage | null => { |
| 174 | const error = params.error ?? null; |
| 175 | const description = params.error_description ?? null; |
| 176 | const value = error ?? description; |
| 177 | if (!value) return null; |
| 178 | return { |
| 179 | short: "OAuth provider rejected authorization", |
| 180 | details: error && description && description !== error ? `${error}: ${description}` : value, |
| 181 | }; |
| 182 | }; |
| 183 | |
| 184 | /** |
| 185 | * Run a plugin's `completeOAuth` against URL params from the OAuth redirect, |