OAuth2 support through library returns The state token is invalid or has expired. Please try again
问题 I have spreadsheets that need to be converted to PDF by various users in my organisation. In order to do that I am trying to use OAuth2 (https://github.com/googlesamples/apps-script-oauth2). When I am using it in a main spreadsheet embedded script it works. However I am trying to move the OAuth2 code to a separate library as there will be many spreadsheets that will need the same functionality. When I am using this library I am getting the message "The state token is invalid or has expired.