mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add logout v2
This commit is contained in:
@@ -19,6 +19,8 @@ import { NotificationTable } from 'src/app/module/notification/data/infra/db/not
|
||||
import { isHttpError } from 'src/app/services/http.service';
|
||||
import { UserRepositoryService } from 'src/app/module/user/data/user-repository.service';
|
||||
import { UserProfilePicture } from 'src/app/module/user/data/datasource/user-local-repository.service';
|
||||
import { UserService } from 'src/app/module/user/domain/user.service'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -69,7 +71,8 @@ export class ProfilePage implements OnInit {
|
||||
private agendaDataRepository: AgendaDataRepositoryService,
|
||||
private toastService: ToastService,
|
||||
private notificationRepositoryService: NotificationRepositoryService,
|
||||
private UserRepositoryService: UserRepositoryService
|
||||
private UserRepositoryService: UserRepositoryService,
|
||||
private UserService:UserService
|
||||
) {
|
||||
|
||||
this.profilePictureSubject = this.UserRepositoryService.getProfilePictureLive() as any
|
||||
@@ -350,29 +353,7 @@ export class ProfilePage implements OnInit {
|
||||
}
|
||||
|
||||
logout() {
|
||||
this.authservice.logoutUser();
|
||||
SessionStore.setInativity(false)
|
||||
SessionStore.setUrlBeforeInactivity(this.router.url);
|
||||
this.logoutOut == false
|
||||
|
||||
if (environment.production) {
|
||||
window.location.pathname = '/auth'
|
||||
this.notificationService.DeletePostToken()
|
||||
} else {
|
||||
const pathBeforeGoOut = window.location.pathname
|
||||
this.router.navigateByUrl('/auth', { replaceUrl: true });
|
||||
this.notificationService.DeletePostToken()
|
||||
|
||||
setTimeout(() => {
|
||||
if (this.logoutOut == false || pathBeforeGoOut == window.location.pathname) {
|
||||
window.location.pathname = '/auth'
|
||||
this.notificationService.DeletePostToken()
|
||||
} else {
|
||||
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
|
||||
this.UserService.logout();
|
||||
}
|
||||
|
||||
async editProfile() {
|
||||
|
||||
Reference in New Issue
Block a user