spotkin
spotkin copied to clipboard
Create a duplicate of the spreadsheet for the user
It would be cool if the script created a duplicate of the spreadsheet for the user if one doesn't exist in the user's google drive. https://docs.google.com/spreadsheets/d/1z5MejG6EKg8rf8vYKeFhw9XT_3PxkDFOrPSEKT_jYqI/edit#gid=467585518
Implemented a function to copy the spreadsheet into the user's Google service account if doesn't exist.
Then I realized that given the way sheets API authentication is currently set up, the sheet was copied into the service account's drive. Even if we prompt the user for their personal email and share the sheet with them, it's a weird solution, since if they delete the service account, the copy of the sheet and their custom config will die with it.
Am I understanding the desired feature add correctly? If yes, then I think changing the authentication process to OAuth so that the user can connect to a sheet in their personal drive is a prerequisite to this feature.
I tried this and the code change is minimal. We could add OAuth as an option so that the current flow still works but a more user-friendly version of this script exists that doesn't require a service account and will automatically copy the spreadsheet into the user's drive. This would require publishing an app on Google Cloud.
Let me know if I'm misunderstanding.
"changing the authentication process to OAuth so that the user can connect to a sheet in their personal drive is a prerequisite to this feature." Ah, yeah, you're absolutely right. I think the change to Oauth will be similar to what @TimStewartJ did in PR #9 when he switched to Spotify Oauth. I don't see any need to preserve the current flow. So feel free to drop that if it makes things simpler. I've never published an app on Google Cloud before but my sense is that it would be good to avoid if possible.