Tried hours on this one now - is there any way to add a parameter to the URL on server side Google Script in a deployed web app, that is open for anyone (not only Google accounts)?
I want to store a key for when a user is logged in, so that the user doesn't have to log in again each time the browser is refreshed.. Say my current url is: https://script.google.com/a/macros.../exec
Can I in some way add in a GAS function at login so that the URL gets modified to something like https://script.google.com/a/macros.../exec?key=abcdef&name=John%20Doe
So that if the doGet(e) function runs again (website reloaded) and if the temporary generated key matches the username in my database, the user will be directed to page B, and if the key doesn't match (or have been deleted on a time trigger) the user will be directed to page A (the login page)?
I also tried to find ways of putting something in the local cache but can't figure that out either.. Google CacheService seem to only store keys on me as a user and not client side.
Example of what I want to achieve:
function doGet(e){
var name = e.parameter.name, output;
if(name === undefined){
/*/
Add parameter name=john to URL..
obviously what I intend to is to create a HtmlOutput on a login-page
and then in a later (function login()) add this parameter there and not
here, but if anyone can work this out for me I got the solution
/*/
} else {
output = HtmlService.createHtmlOutput('Welcome back ' + name);
}
return output;
}