Skip to content

Commit

Permalink
Adjust ability injection variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Feb 17, 2023
1 parent 2c1d961 commit f37a533
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/web-runtime/src/services/auth/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class AuthService {
clientService: this.clientService,
configurationManager: this.configurationManager,
store: this.store,
$ability: this.$ability
ability: this.$ability
})

this.userManager.events.addAccessTokenExpired((...args): void => {
Expand Down
8 changes: 4 additions & 4 deletions packages/web-runtime/src/services/auth/userManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface UserManagerOptions {
clientService: ClientService
configurationManager: ConfigurationManager
store: Store<any>
$ability: Ability
ability: Ability
}

export class UserManager extends OidcUserManager {
Expand All @@ -29,7 +29,7 @@ export class UserManager extends OidcUserManager {
private store: Store<any>
private updateAccessTokenPromise: Promise<void> | null
private _unloadReason: UnloadReason
private $ability: Ability
private ability: Ability

constructor(options: UserManagerOptions) {
const storePrefix = 'oc_oAuth.'
Expand Down Expand Up @@ -86,7 +86,7 @@ export class UserManager extends OidcUserManager {
this.clientService = options.clientService
this.configurationManager = options.configurationManager
this.store = options.store
this.$ability = options.$ability
this.ability = options.ability
}

/**
Expand Down Expand Up @@ -271,6 +271,6 @@ export class UserManager extends OidcUserManager {
private async updateUserAbilities(user, accessToken) {
const permissions = await this.fetchPermissions({ user, accessToken })
const abilities = getAbilities(permissions)
this.$ability.update(abilities)
this.ability.update(abilities)
}
}

0 comments on commit f37a533

Please sign in to comment.