Skip to content

Commit

Permalink
fix: sso scope profile migration without any profile (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
recursivetree authored Feb 11, 2025
1 parent a2f0de4 commit 0d17d22
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@ public function up()
'esi-characters.read_opportunities.v1',
];

$sso_scopes_setting = DB::table('global_settings')->where('name', 'sso_scopes')->first();

// if no sso scope settings have been configured, we don't have anything to migrate
if($sso_scopes_setting === null) return;

// Fix the global_settings
$profiles = json_decode(DB::table('global_settings')->where('name', 'sso_scopes')->first()->value);
$profiles = json_decode($sso_scopes_setting->value);
foreach($profiles as &$profile) {
foreach($remove_scopes as $rs) {
foreach(array_keys($profile->scopes, $rs, true) as $key) {
Expand Down

0 comments on commit 0d17d22

Please sign in to comment.