doctype html
html
    head
        meta(charset='utf-8')
        meta(http-equiv='X-UA-Compatible' content='IE=edge')
        meta(name='viewport' content='width=device-width, initial-scale=1')
        title SBI-SG 
        //- link(rel='apple-touch-icon' sizes='180x180' href='/assets/images/favicons/apple-touch-icon.png')
        //- link(rel='icon' type='image/png' sizes='32x32' href='/assets/images/favicons/favicon-32x32.png')
        //- link(rel='icon' type='image/png' sizes='16x16' href='/assets/images/favicons/favicon-16x16.png')
        //- link(rel='shortcut icon' type='image/x-icon' href='/assets/images/favicons/favicon.ico')
        //- link(rel='manifest' href='/assets/images/favicons/manifest.json')
        //- link(rel='mask-icon' href='/assets/images/favicons/safari-pinned-tab.svg' color='#5bbad5')
        meta(name='msapplication-TileImage' content='/assets/images/favicons/mstile-150x150.png')
        meta(name='theme-color' content='#ffffff')
        link(href='/assets/lib/bootstrap/dist/css/bootstrap.min.css' rel='stylesheet')
        link(href='/assets/lib/loaders.css/loaders.min.css' rel='stylesheet')
        link(href='/assets/css/montserrate_opensans.css' rel='stylesheet')
        link(href='/assets/lib/iconsmind/iconsmind.css' rel='stylesheet')
        link(href='/assets/css/ionicons.min.css' rel='stylesheet')
        link(href='/assets/lib/hamburgers/dist/hamburgers.min.css' rel='stylesheet')
        link(href='/assets/lib/font-awesome/css/font-awesome.min.css' rel='stylesheet')
        link(href='/assets/lib/owl.carousel/dist/assets/owl.carousel.min.css' rel='stylesheet')
        link(href='/assets/lib/owl.carousel/dist/assets/owl.theme.default.min.css' rel='stylesheet')
        link(href='/assets/lib/remodal/dist/remodal.css' rel='stylesheet')
        link(href='/assets/lib/remodal/dist/remodal-default-theme.css' rel='stylesheet')
        link(href='/assets/lib/flexslider/flexslider.css' rel='stylesheet')
        link(href='/assets/lib/lightbox2/dist/css/lightbox.css' rel='stylesheet')
        link(href='/assets/css/style.css' rel='stylesheet')
        link(href='/assets/css/custom.css' rel='stylesheet')
        script(src='/assets/js/modernizr.min.js')
        script(src='/assets/lib/jquery/dist/jquery.min.js')
        script(src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js' integrity='sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4' crossorigin='anonymous')
        script(src='/assets/lib/bootstrap/dist/js/bootstrap.min.js')
        script(src='/assets/lib/imagesloaded/imagesloaded.pkgd.min.js')
        script(src='/assets/lib/gsap/src/minified/TweenMax.min.js')
        script(src='/assets/lib/gsap/src/minified/plugins/ScrollToPlugin.min.js')
        script(src='/assets/lib/CustomEase.min.js')
        script(src='/assets/js/config.js')
        script(src='/assets/js/googlemap.js')
    script(src='https://maps.googleapis.com/maps/api/js?key=AIzaSyCoK8GIrOHzHwnzHCyqrdtmTpUWcdrTTD8&callback=initMap' async='')
        script(src='/assets/js/zanimation.js')
        script(src='/assets/js/inertia.js')
        script(src='/assets/lib/owl.carousel/dist/owl.carousel.min.js')
        script(src='/assets/lib/remodal/dist/remodal.js')
        script(src='/assets/lib/lightbox2/dist/js/lightbox.js')
        script(src='/assets/lib/flexslider/jquery.flexslider-min.js')
        script(src='/assets/js/core.js')
        script(src='/assets/js/main.js')
        script(src='/assets/js/sweetalert2011.js')
    body 
        iframe#derivativesiframe(style='height:100%;width:100%;position:fixed;top:0px;left:0px;z-index:40' scrolling='yes' frameborder='0px') 
        script.
            $(document).ready(function() {
                let urlParams = new URLSearchParams(window.location.search);
                let token = urlParams.get('token');
                if(!token) {
                    location.href="/login";
                    return;
                }

                $.get("http://localhost:1337/ssg/loginForClients/" + token, function(data) {
                    if(data.errormsg) {
                        Swal.fire({
                            icon: 'error',
                            title: 'Oops...',
                            text: data.errormsg
                        }).then(() => location.href="/login");
                    } else {
                        $('#derivativesiframe').attr('src', data.data)
                    }
                })
            })