🔧 jwt decode link: https://www.npmjs.com/package/jwt-decode
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
npm i jwt-decode
verifyJwt.ts****
import { jwtDecode } from 'jwt-decode';
export const verifyToken = (token: string) => {
return jwtDecode(token);
};Login.tsx****
const onSubmit = async (data) => {
console.log(data);
const userInfo = {
id: data.id,
password: data.password,
};
const res = await login(userInfo).unwrap();
const user = verifyToken(res.data.accessToken);
dispatch(setUser({ user: user, token: res.data.accessToken }));
};
⚠️ NPMJS gitlabhook 0.0.17 Remote Command Execution
📈 28.41 Punkte
⚠️ PoC
🔧 Create JWT Using DataWeave JWT Library
📈 25.97 Punkte
🔧 Programmierung