feat: strava deeplink to mobile
This commit is contained in:
@@ -15,15 +15,14 @@ class StravaClient
|
||||
public function authorizationUrl(string $state): string
|
||||
{
|
||||
$clientId = config('services.strava.client_id');
|
||||
$redirectUri = config('services.strava.redirect_uri');
|
||||
|
||||
if (! $clientId || ! $redirectUri) {
|
||||
if (! $clientId) {
|
||||
throw new RuntimeException('Strava is not configured.');
|
||||
}
|
||||
|
||||
return self::AUTHORIZE_URL.'?'.http_build_query([
|
||||
'client_id' => $clientId,
|
||||
'redirect_uri' => $redirectUri,
|
||||
'redirect_uri' => $this->redirectUri(),
|
||||
'response_type' => 'code',
|
||||
'approval_prompt' => 'auto',
|
||||
'scope' => config('services.strava.scope', 'read,activity:read'),
|
||||
@@ -97,4 +96,9 @@ class StravaClient
|
||||
->connectTimeout(3)
|
||||
->retry([100, 500, 1000]);
|
||||
}
|
||||
|
||||
private function redirectUri(): string
|
||||
{
|
||||
return rtrim((string) config('app.url'), '/').'/strava/callback';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user