jwt refresh token 1.1
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
//Разобраться с хранением и использованием refresh token
|
||||
//Добавить endpoint logout
|
||||
|
||||
const token = localStorage.getItem("token");
|
||||
if (token) {
|
||||
window.location.href = "./../main/index.html";
|
||||
function getToken() {
|
||||
return localStorage.getItem("token") || sessionStorage.getItem("token");
|
||||
}
|
||||
function tokenCheck(){
|
||||
const token = getToken();
|
||||
if (!token) {
|
||||
window.location.href = "./../main/index.html";
|
||||
}
|
||||
}
|
||||
document.getElementById('loginForm').addEventListener('submit', async function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user