Первый коммит после распаковки архива
This commit is contained in:
36
src/api/auth.js
Normal file
36
src/api/auth.js
Normal file
@@ -0,0 +1,36 @@
|
||||
// src/api/auth.js
|
||||
export async function registerStep1(data) {
|
||||
const r = await fetch('/api/register-step1', {
|
||||
method: 'POST', headers: {'Content-Type':'application/json'},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
return r.json();
|
||||
}
|
||||
export async function registerStep2(data, token) {
|
||||
const r = await fetch('/api/register-step2', {
|
||||
method:'POST', headers:{
|
||||
'Content-Type':'application/json',
|
||||
'Authorization': `Bearer ${token}`
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
return r.json();
|
||||
}
|
||||
export async function registerStep3(data, token) {
|
||||
const r = await fetch('/api/register-step3', {
|
||||
method:'POST', headers:{
|
||||
'Content-Type':'application/json',
|
||||
'Authorization': `Bearer ${token}`
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
return r.json();
|
||||
}
|
||||
export async function login(data) {
|
||||
const r = await fetch('/api/login', {
|
||||
method:'POST', headers:{'Content-Type':'application/json'},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
return r.json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user