Skip to content

Commit

Permalink
Adding latest updates and language
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Jun 2, 2024
2 parents af0357e + d9b2e18 commit d262840
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
21 changes: 10 additions & 11 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
Route::get('auth/{driver}/callback', [SocialController::class, 'callback']);
});


Route::get('hey', function(){
$rowsArray = [];
$socialProviders = config('devdojo.auth.providers', []);

foreach($socialProviders as $key => $provider){
$provider['slug'] = $key;
array_push($rowsArray, $provider);
}
dd($rowsArray);
});
Route::get('hey', function () {
$rowsArray = [];
$socialProviders = config('devdojo.auth.providers', []);

foreach ($socialProviders as $key => $provider) {
$provider['slug'] = $key;
array_push($rowsArray, $provider);
}
dd($rowsArray);
});
9 changes: 6 additions & 3 deletions src/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Devdojo\Auth\Http\Middleware\TwoFactorChallenged;
use Devdojo\Auth\Http\Middleware\TwoFactorEnabled;
use Devdojo\Auth\Http\Middleware\ViewAuthSetup;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\ServiceProvider;
use Laravel\Folio\Folio;
use Livewire\Livewire;
Expand Down Expand Up @@ -101,11 +101,13 @@ private function registerVoltDirectory(): void
]);
}

private function handleStarterKitFunctionality(){
private function handleStarterKitFunctionality()
{
$this->jetstreamFunctionality();
}

private function jetstreamFunctionality(){
private function jetstreamFunctionality()
{
// We check if fortify is installed and the user has enabled 2FA, if so we want to enable that feature
if (class_exists(\Laravel\Fortify\Features::class) && config('devdojo.auth.settings.enable_2fa')) {
Config::set('fortify.features', array_merge(
Expand All @@ -119,6 +121,7 @@ private function jetstreamFunctionality(){
));
}
}

/**
* Register the application services.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public static function activeProviders()
return $activeProviders;
}

public static function getProvidersFromArray($array){
public static function getProvidersFromArray($array)
{
$providers = config('devdojo.auth.providers');
$providersInArray = [];
foreach ($providers as $slug => $provider) {
Expand Down
6 changes: 3 additions & 3 deletions src/Models/SocialProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class SocialProvider extends Model
public function getRows()
{
// Fetching the social providers from the configuration file
$rowsArray = [];
$rowsArray = [];
$socialProviders = config('devdojo.auth.providers', []);
foreach($socialProviders as $key => $provider){

foreach ($socialProviders as $key => $provider) {
$provider['slug'] = $key;
array_push($rowsArray, $provider);
}
Expand Down

0 comments on commit d262840

Please sign in to comment.