Dropbox
Dropbox copied to clipboard
How to set to the userID dynamically for each user?
I have a login system, from which i'd like to insert when the user registers, their 'user_id' into the userID for the dropbox table? a foreign key of sorts?
Is this possible? seems to be hardcoded as 1?
Hi @xbroak
Apologies, you've probably resolved this by now, but I thought I'd reply instead of just closing the ticket. The library is authentication system agnostic. When a user registers, you'd retrieve a Dropbox access token for them, taking them through the OAuth flow, and then store it for their user ID. The only thing you'd need to do is retrieve their user ID from your users table and pass it to the storage handler when you create it e.g.
$userID = $loggedInUser->user_id;
$storage = new \Dropbox\OAuth\Storage\PDO($encrypter, $userID);
Hope this helps someone :)