Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
public function up(): void
{
Schema::table('social_provider_user', function (Blueprint $table) {
$table->text('token')->change();
});
}

public function down(): void
{
Schema::table('social_provider_user', function (Blueprint $table) {
$table->string('token', 400)->change();
});
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
public function up(): void
{
Schema::table('social_provider_user', function (Blueprint $table) {
// Change refresh_token column to text type
$table->text('refresh_token')->change();
});
}

public function down(): void
{
Schema::table('social_provider_user', function (Blueprint $table) {
$table->string('refresh_token')->change();
});
}
};
4 changes: 3 additions & 1 deletion src/Http/Controllers/SocialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function redirect(Request $request, string $driver): RedirectResponse
{
$this->dynamicallySetSocialProviderCredentials($driver);

return Socialite::driver($driver)->redirect();
$scopes = config('devdojo.auth.providers.'.$driver.'.scopes', []);

return Socialite::driver($driver)->scopes($scopes)->redirect();
}

private function dynamicallySetSocialProviderCredentials($provider)
Expand Down
5 changes: 5 additions & 0 deletions src/Models/SocialProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function getRows()

foreach ($socialProviders as $key => $provider) {
$provider['slug'] = $key;

if (isset($provider['scopes']) && is_array($provider['scopes'])) {
$provider['scopes'] = implode(',', $provider['scopes']);
}

array_push($rowsArray, $provider);
}

Expand Down
Loading