Different JavaScript origin for the same web app on each computer causes Error: redirect_uri_mismatch

后端 未结 1 1426
既然无缘
既然无缘 2020-12-07 04:00

I have published a WebApp with Google sign in using Google apps script. Every time you log into your google account on another computer to access this web-app, an error will

相关标签:
1条回答
  • 2020-12-07 04:46

    This may not work, but you can default to 0 using this script at index.html:

    <script>
      if(!/-0lu/.test(location.href)){ 
        location.href = location.href.toString().replace(/-\d+lu/,'-0lu');
      }
    </script>
    

    Your web-app script.google.com has a sandboxed iframe *[DIGIT]lu-script.googleusercontent.com. We're just trying to change the location of this iframe using regex. If something other than 0lu is present as iframe, We replace it to 0lu

    0 讨论(0)
提交回复
热议问题