Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OktaAuthModule.forRoot() #118

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

denysoblohin-okta
Copy link
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Adding Tests
  • Build related changes
  • CI related changes
  • Documentation changes
  • Other... Please describe:

What is the current behavior?

Currently the only way to import OktaAuthModule is as follows:

import { OktaAuthModule, OKTA_CONFIG } from '@okta/okta-angular';

@NgModule({
  imports: [
    ...
    OktaAuthModule
  ],
  providers: [
    { 
      provide: OKTA_CONFIG, 
      useValue: { oktaAuth } 
    }
  ],
})
export class MyAppModule { }

Issue Number: OKTA-567263

What is the new behavior?

Using forRoot() pattern to create OktaAuthModule as a singleton is a preferred way:

import { OktaAuthModule } from '@okta/okta-angular';

@NgModule({
  imports: [
    ...
    OktaAuthModule.forRoot({ oktaAuth })
  ]
})
export class MyAppModule { }

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Need to release this change with minor version bump (6.2.0).
Added note to MIGRATING.md about new preferred way to import OktaAuthModule as a singleton.

Reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants