add token login and publication hub connection

This commit is contained in:
Peter Maquiran
2024-07-26 17:00:06 +01:00
parent c91086fcef
commit aef52722e8
4 changed files with 23 additions and 43 deletions
+15 -15
View File
@@ -114,23 +114,23 @@ export class TokenInterceptor implements HttpInterceptor {
}),
catchError((error) => {
console.log(error)
// SessionStore.user.Authorization = SessionStore.user.Authorization;
// SessionStore.user.RefreshToken = SessionStore.user.RefreshToken;
// SessionStore.setInativity(false)
// /* SessionStore.setUrlBeforeInactivity(this.router.url); */
SessionStore.user.Authorization = SessionStore.user.Authorization;
SessionStore.user.RefreshToken = SessionStore.user.RefreshToken;
SessionStore.setInativity(false)
/* SessionStore.setUrlBeforeInactivity(this.router.url); */
// if (environment.production) {
// window.location.pathname = '/auth'
// } else {
// const pathBeforeGoOut = window.location.pathname
// console.log('Before auth',window.location.pathname)
// this.router.navigateByUrl('/auth', { replaceUrl: true }).then(() =>{
// if(pathBeforeGoOut != "/auth") {
// this.httpErrorHandle.httpsSucessMessagge('sessonExpired')
// }
if (environment.production) {
window.location.pathname = '/auth'
} else {
const pathBeforeGoOut = window.location.pathname
console.log('Before auth',window.location.pathname)
this.router.navigateByUrl('/auth', { replaceUrl: true }).then(() =>{
if(pathBeforeGoOut != "/auth") {
this.httpErrorHandle.httpsSucessMessagge('sessonExpired')
}
// })
// }
})
}
return of(false);
})
);
@@ -175,27 +175,7 @@ export class NewPublicationPage implements OnInit {
}
ngOnInit() {
// this.reciveSharedContent();
// this.setTitle();
// Filesystem.mkdir({
// path: IMAGE_DIR,
// directory: Directory.Data,
// recursive: true
// });
/* try {
document.addEventListener("click", clickOutside, false);
function clickOutside(e) {
const inside = document.getElementById('container-multiselect').contains(e.target);
this.photoOrVideo = false;
console.log(this.photoOrVideo)
}
} catch (error) {
console.log('click butto', error)
} */
}
ngOnInit() {}
// in use
async takePicture() {
@@ -56,7 +56,7 @@ export class PublicationFromMvService {
this.ObjectMergeNotification = new ObjectMergeNotification()
this.totalPercentage = 0
// this.ObjectMergeNotification.connect();
this.ObjectMergeNotification.connect();
window['upload-header-set-add'](this.id, this.totalPercentage, this.save)
}