mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: account deletion; auto incremental uids; display name renaming UI + account deletion UI; enhanced username validation
This commit is contained in:
@@ -98,3 +98,15 @@ export function clearServerTokens(cookies: Cookies) {
|
||||
cookies.delete('token', { path: '/' });
|
||||
cookies.delete('refreshToken', { path: '/' });
|
||||
}
|
||||
|
||||
export function getUserUUIDFromToken() {
|
||||
if (!browser) return null;
|
||||
const token = getToken();
|
||||
if (!token) return null;
|
||||
try {
|
||||
const payload = JSON.parse(atob(token.split('.')[1]));
|
||||
return payload.UUID || null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user