Why is my script pushing an incorrect URL? [/u/2 inserted into script URL]

混江龙づ霸主 提交于 2021-02-05 12:00:52

问题


I'm an GAS novice, attempting to keep an application afloat during a time of transition, and the following issue began presenting recently. Although the script is pushing a URL (for another published script) into a menu item link ... (see images)

set variable as URL

include in nav item hyperlink

...the URL set via the script is not what is being accessed by some (not all) individuals in the published application. Rather than their link opening a URL beginning with "https://script.google.com/macros/s/AK...", some users being directed to URLs that begin with "https://script.google.com/macros/u/2/s/AK...". (Note the addition of the /u/2) Please see screenshot below.

screenshot of URL linked through published application

Any thoughts on how to identify potential issues is appreciated.


回答1:


/u/2 (the number could vary) are added by Google on web applications that use Google accounts when the user is signed in a Google account.

The numbers vary when the user have signed in in multiple Google accounts:

  • 0 is for the default account
  • 1 for the second account
  • 2 for the third account, etc.

Regarding potencial issues, there is know issue related to this that usually happens when the client-side code calls a server side function that requires to access a private doc, file, form, slide, spreadsheet.

Related

  • AuthMode gets confused w/ multiple logged in users


来源:https://stackoverflow.com/questions/63709693/why-is-my-script-pushing-an-incorrect-url-u-2-inserted-into-script-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!