@annalib/anna-cognito-lib 2.2.35 → 2.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -165,7 +165,7 @@ class AnnaLibAuthService {
165
165
  try {
166
166
  let session = await fetchAuthSession();
167
167
  if (session?.tokens) {
168
- this.handleSignOut();
168
+ await this.handleSignOut();
169
169
  }
170
170
  const { isSignedIn, nextStep } = await signIn({ username, password });
171
171
  switch (nextStep?.signInStep) {
@@ -331,9 +331,13 @@ class AnnaLibAuthService {
331
331
  async signInWithSSO() {
332
332
  let session = await fetchAuthSession();
333
333
  if (session?.tokens) {
334
- await this.handleSignOut();
334
+ await this.handleSignOut().then(response => {
335
+ this.consumingProjectAuthService.signInWithSSO();
336
+ });
337
+ }
338
+ else {
339
+ this.consumingProjectAuthService.signInWithSSO();
335
340
  }
336
- this.consumingProjectAuthService.signInWithSSO();
337
341
  }
338
342
  async handleSignOut() {
339
343
  try {