Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

How to set to the userID dynamically for each user? #90

Open
broakenmedia opened this issue Jan 26, 2014 · 1 comment
Open

How to set to the userID dynamically for each user? #90

broakenmedia opened this issue Jan 26, 2014 · 1 comment

Comments

@broakenmedia
Copy link

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?

@BenExile
Copy link
Owner

BenExile commented Aug 5, 2014

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 :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants