Impossible to define dynamic user token #179
Replies: 5 comments 1 reply
-
Have you found a solution? I need this also |
Beta Was this translation helpful? Give feedback.
-
I am also wondering how to do this |
Beta Was this translation helpful? Give feedback.
-
I need this too, unless this is out of this package scope I can PR solution @freekmurze @Gummibeer ? |
Beta Was this translation helpful? Give feedback.
-
I also need it urgently |
Beta Was this translation helpful? Give feedback.
-
You can easliy override Laravel config on a per user basis, here is how I do it: // First override Laravel default config for given user
Config::set('google-calendar', [
'auth_profiles' => [
'service_account' => [
'credentials_json' => storage_path('app/google-calendar/api-key-' . Auth::id() . '.json'),
]
],
'calendar_id' => Auth::user()->preference->google_calendar_id,
] + config('google-calendar'));
// Then interact with the API
$googleEvent = new GoogleEvent;
... |
Beta Was this translation helpful? Give feedback.
-
In GoogleCalendarFactory , method createOAuthClient
$client->setAccessToken(file_get_contents($authProfile['token_json']));
It's meens it's always the same $client who is use.
How to add the event to another user's google account ?
Beta Was this translation helpful? Give feedback.
All reactions