@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
19 lines (17 loc) • 594 B
HTML
<!-- SPDX-License-Identifier: Apache-2.0 -->
<script type="module">
try {
const url = new URL(window.location.href);
const params = url.searchParams;
if (params.has('error')) {
window.parent.postMessage(
{ type: 'OAUTH_ERROR', error: `${params.get('error')}: ${params.get('error_description')}` },
'*'
);
} else {
window.parent.postMessage({ type: 'OAUTH_CALLBACK', data: Object.fromEntries(params.entries()) }, '*');
}
} catch (error) {
window.parent.postMessage({ type: 'OAUTH_ERROR', error: error.message }, '*');
}
</script>