diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-14 21:55:59 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-11-14 21:55:59 +0100 |
| commit | 3f18f02d07802d1fc705a500e5978a9b3cb2e751 (patch) | |
| tree | 283970a2f5a693706456b853c550eeaa669b5d72 /static/api/auth.js | |
| parent | 351ad457f0ff95e20301a146b8c88a8f0f659aa1 (diff) | |
implement login
Diffstat (limited to 'static/api/auth.js')
| -rw-r--r-- | static/api/auth.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/static/api/auth.js b/static/api/auth.js new file mode 100644 index 0000000..e663d88 --- /dev/null +++ b/static/api/auth.js @@ -0,0 +1,12 @@ +import * as rest from './rest.js'; + + +export async function login(user, password) { + const response = await rest.post('/api/auth/login', { user, password }); + return response?.success ?? false; +} + +export async function is_first_login(user) { + const response = await rest.post('/api/auth/first-login', { user }); + return response?.is_first ?? false; +} |