Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
<mat-grid-tile [colspan]="1" [rowspan]="3">
<img src="assets/logo-lightning-talk.png" alt="Logo da Lightning Talk">
</mat-grid-tile>
<mat-grid-tile [colspan]="1" [rowspan]="1">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkacunha what happens when user no have active session?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@altitdb The MsalInterceptor to force a new login when a request by way HttpClient return status 401 or 403

<button mat-raised-button color="primary" class="default-button scheduling-button" (click)="logar()">
Autenticar
</button>
</mat-grid-tile>
</mat-grid-list>


Expand Down
32 changes: 17 additions & 15 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { BroadcastService, MsalService } from '@azure/msal-angular';
import { OutlookSchedulerService } from './services/outlook-scheduler.service';
import { LightningTalk } from './model/lightning-talk';
Expand Down Expand Up @@ -34,21 +34,23 @@ export class AppComponent {

if (this.isLogged()) {
this.updateLoggedUserInfo();
}

this.broadcastService.subscribe("msal:loginSuccess", (payload) => {
this.updateLoggedUserInfo();
});

this.formLt = this.formBuilder.group({
title: ['', Validators.required],
description: ['', Validators.required],
date: ['', Validators.required],
startTime: ['', [Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]],
endTime: ['', [ Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]],
tranmissionNeeds: [''],
technical: [false]
}, { validators: this.endTimeGreatherThanStartTimeValidator() });
this.broadcastService.subscribe("msal:loginSuccess", (payload) => {
this.updateLoggedUserInfo();
});

this.formLt = this.formBuilder.group({
title: ['', Validators.required],
description: ['', Validators.required],
date: ['', Validators.required],
startTime: ['', [Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]],
endTime: ['', [ Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]],
tranmissionNeeds: [''],
technical: [false]
}, { validators: this.endTimeGreatherThanStartTimeValidator() });
} else {
this.logar();
}
}

abrirCalendario(item){
Expand Down