Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Changes to fix to use property for temporary storing identity provide…
Browse files Browse the repository at this point in the history
…r type. (#10972)
  • Loading branch information
hanzlamateen authored Aug 15, 2024
1 parent de14a0a commit 089e39e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async function addIdentityProviderType(context: HookContext<IdentityProviderServ
})

if (adminScopes.total === 0 && (isDev || (context.actualData as IdentityProviderData).type !== 'guest')) {
;(context.actualData as IdentityProviderData).type = 'admin'
context.isAdmin = true
}
}

Expand Down Expand Up @@ -245,7 +245,7 @@ async function createNewUser(context: HookContext<IdentityProviderService>) {
/* (AFTER) CREATE HOOKS */

async function addScopes(context: HookContext<IdentityProviderService>) {
if (isDev && (context.actualData as IdentityProviderType).type === 'admin') {
if (isDev && context.isAdmin === true) {
// in dev mode, add all scopes to the first user made an admin
const scopeTypes = await context.app.service(scopeTypePath).find({
paginate: false
Expand Down

0 comments on commit 089e39e

Please sign in to comment.