mirror of
https://github.com/myfatemi04/wheelshare-frontend.git
synced 2025-04-21 19:29:51 -04:00
17 lines
361 B
TypeScript
17 lines
361 B
TypeScript
export async function createSession(code: string, redirectUrl: string) {
|
|
const res = await fetch('http://localhost:5000/create_session', {
|
|
method: 'post',
|
|
body: JSON.stringify({ code, redirectUrl }),
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
});
|
|
|
|
const json = await res.json();
|
|
|
|
return {
|
|
status: json.status,
|
|
token: json.token,
|
|
};
|
|
}
|