mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: refactor refresh token handling; update schema and logic for improved security and functionality
This commit is contained in:
@@ -58,7 +58,7 @@ export async function refreshTokenIfNeeded() {
|
||||
});
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
if (data.token.token && data.token.refreshToken && data.token.success) {
|
||||
if (data.success && data.token?.token && data.token?.refreshToken) {
|
||||
console.log('Token refreshed successfully');
|
||||
setTokens(data.token.token, data.token.refreshToken);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user