-เพิ่ม pkg jose ไว้ encrypt secret key
All checks were successful
Build Docker Image / Build Docker Image (push) Successful in 6m5s
All checks were successful
Build Docker Image / Build Docker Image (push) Successful in 6m5s
-jwt services/jwt.service.ts -เพิ่ม เวลา expire jwt token
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, HostListener, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { trigger, state, style, transition, animate } from '@angular/animations';
|
||||
import { JwtService } from '../../services/jwt.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sidebar',
|
||||
@@ -28,7 +29,10 @@ export class SidebarComponent implements OnInit {
|
||||
isMobile = false; // ตรวจอุปกรณ์
|
||||
showOverlay = false; // สำหรับ mobile overlay
|
||||
|
||||
constructor(private router: Router) {}
|
||||
constructor(
|
||||
private router: Router,
|
||||
private jwtService: JwtService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.checkDevice();
|
||||
@@ -60,7 +64,6 @@ export class SidebarComponent implements OnInit {
|
||||
}
|
||||
|
||||
logout() {
|
||||
localStorage.removeItem('access_token');
|
||||
this.router.navigate(['/login']);
|
||||
this.jwtService.logout();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user