MCPcopy Create free account
hub / github.com/error311/FileRise / fetchCurrentUser

Function fetchCurrentUser

public/js/userPanel.js:15–26  ·  view source on GitHub ↗

* Fetch current user info (username, profile_picture, totp_enabled)

()

Source from the content-addressed store, hash-verified

13 * Fetch current user info (username, profile_picture, totp_enabled)
14 */
15async function fetchCurrentUser() {
16 try {
17 const res = await fetch(withBase('/api/profile/getCurrentUser.php'), {
18 credentials: 'include'
19 });
20 if (!res.ok) throw new Error(`HTTP ${res.status}`);
21 return await res.json();
22 } catch (e) {
23 console.warn('fetchCurrentUser failed:', e);
24 return {};
25 }
26}
27
28/**
29 * Normalize any profile‐picture URL:

Callers 1

openUserPanelFunction · 0.85

Calls 1

withBaseFunction · 0.85

Tested by

no test coverage detected