Spaces:
Runtime error
Runtime error
Download frontend/src/api/auth.js from cuiconnect/backend: direct link, hf CLI and curl.
- Browser
- Download file 859 Bytes
-
https://huggingface.co/spaces/cuiconnect/backend/resolve/main/frontend/src/api/auth.js
- Command line
-
hf download hf://spaces/cuiconnect/backend/frontend/src/api/auth.js
-
curl -L -o auth.js https://huggingface.co/spaces/cuiconnect/backend/resolve/main/frontend/src/api/auth.js
859 Bytes
| import { apiJson } from './http' | |
| export function login(email, password) { | |
| return apiJson('/users/login', { | |
| method: 'POST', | |
| body: JSON.stringify({ email, password }), | |
| auth: false, | |
| }) | |
| } | |
| export function signup({ email, password, full_name }) { | |
| const body = { email, password } | |
| if (full_name?.trim()) body.full_name = full_name.trim() | |
| return apiJson('/users', { | |
| method: 'POST', | |
| body: JSON.stringify(body), | |
| auth: false, | |
| }) | |
| } | |
| export function refreshTokens(refresh_token) { | |
| return apiJson('/users/refresh', { | |
| method: 'POST', | |
| body: JSON.stringify({ refresh_token }), | |
| auth: false, | |
| }) | |
| } | |
| export function getProfile() { | |
| return apiJson('/users/me', { auth: true }) | |
| } | |
| export function updateProfile(body) { | |
| return apiJson('/users/me', { | |
| method: 'PATCH', | |
| body: JSON.stringify(body), | |
| auth: true, | |
| }) | |
| } | |