Skip to content

Commit

Permalink
fix: undesired logout after contact us submission (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKless authored May 27, 2021
1 parent 7ebf2fa commit a76d4a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/core/utils/api-token/api-token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class ApiTokenService {
if (apiToken) {
if (apiToken.startsWith('AuthenticationTokenOutdated') || apiToken.startsWith('AuthenticationTokenInvalid')) {
this.invalidateApiToken();
} else if (!event.url.endsWith('/configurations')) {
} else if (!event.url.endsWith('/configurations') && !event.url.endsWith('/contact')) {
this.setApiToken(apiToken);
}
}
Expand Down
9 changes: 0 additions & 9 deletions src/app/pages/contact/contact-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ import { debounce, filter, takeUntil } from 'rxjs/operators';

import { AccountFacade } from 'ish-core/facades/account.facade';
import { Contact } from 'ish-core/models/contact/contact.model';
import { User } from 'ish-core/models/user/user.model';

@Component({
selector: 'ish-contact-page',
templateUrl: './contact-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ContactPageComponent implements OnInit, OnDestroy {
/**
* The list of confirmation subjects to choose from.
*/
subjects$: Observable<string[]>;
/**
* Indicator for any loading state.
*/
Expand All @@ -27,17 +22,13 @@ export class ContactPageComponent implements OnInit, OnDestroy {
*/
success$: Observable<boolean>;

user$: Observable<User>;

private destroy$ = new Subject();

constructor(private accountFacade: AccountFacade, private router: Router) {}

ngOnInit() {
this.subjects$ = this.accountFacade.contactSubjects$();
this.loading$ = this.accountFacade.contactLoading$;
this.success$ = this.accountFacade.contactSuccess$;
this.user$ = this.accountFacade.user$;

// reset contact page if the user routes to 'contact' again after a contact form submission
this.router.events
Expand Down

0 comments on commit a76d4a6

Please sign in to comment.