jv3-jwt
install
npm install jv3-login-jwt
init to Vue3 app
/* main.js */
import { createApp } from "vue";
import App from "./App.vue";
import router from "./router/example-router";
// install plugins
import auth from "jv3-jwt";
const app = createApp(App);
app.use(auth, {
router,
url: "http://localhost:8080",
// apiUrl: "/auth",
path_login: "auth/basic/verify",
path_refresh: "auth/basic/refresh",
path_user: "user/me",
login: () => {},
logout: () => {},
exceptions: [],
jwtStorage: "jwt",
authStorage: "jauth",
defaultRoutePath: "/",
customLogin: () => {},
callbackLogin: () => {},
customLogout: () => {},
callbackLogout: () => {},
handleError: (error) => {
console.log(error);
},
title: "Sigin",
hello: "Hello นี้คือระบบล็อกอิน แบบง่าย"
});
app.use(router);
app.mount("#app");