Password Reset
Endpoint untuk reset password dan pelaporan masalah. Semua endpoint di bagian ini tidak memerlukan authentication.
POST /auth/forgot-password
Kirim email reset password. Untuk keamanan, selalu return success meskipun email tidak terdaftar.
Request Body
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
email | string | Ya | Email user |
Contoh Request
curl -X POST https://fumai.app/api/mobile/v1/auth/forgot-password \
-H "Content-Type: application/json" \
-d '{ "email": "user@example.com" }'const res = await fetch('https://fumai.app/api/mobile/v1/auth/forgot-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'user@example.com' }),
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"message": "Jika email terdaftar, link reset password akan dikirim."
}
}Behavior
- Selalu return
success: true(tidak reveal apakah email terdaftar) - Email hanya dikirim jika user ada DAN punya password (bukan OAuth-only)
- Link reset berlaku 1 jam
Rate Limit: 3 per jam (per IP)
GET /auth/reset-password
Cek apakah token reset password masih valid.
Query Parameters
| Parameter | Tipe | Wajib | Keterangan |
|---|---|---|---|
token | string | Ya | Token dari email link |
email | string | Ya | Email user |
Contoh Request
curl -X GET "https://fumai.app/api/mobile/v1/auth/reset-password?token=HEX_TOKEN&email=user@example.com"const res = await fetch(
`https://fumai.app/api/mobile/v1/auth/reset-password?token=${token}&email=${email}`
)
const data = await res.json()Response 200
{
"success": true,
"data": {
"valid": true
}
}POST /auth/reset-password
Reset password dengan token yang valid.
Request Body
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
email | string | Ya | Email user |
token | string | Ya | Token dari email |
password | string | Ya | Password baru (min 8 karakter) |
Contoh Request
curl -X POST https://fumai.app/api/mobile/v1/auth/reset-password \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"token": "hex_token_from_email",
"password": "NewPassword123"
}'const res = await fetch('https://fumai.app/api/mobile/v1/auth/reset-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'user@example.com',
token: 'hex_token_from_email',
password: 'NewPassword123',
}),
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"message": "Password berhasil diubah. Silakan login dengan password baru."
}
}Behavior
- Token one-time use (otomatis dihapus setelah reset)
- Email konfirmasi otomatis dikirim setelah reset berhasil
POST /auth/report-issue
Endpoint untuk user melaporkan masalah (tidak bisa login, akun bermasalah, dll).
Tidak memerlukan authentication.
Request Body
| Field | Tipe | Wajib | Keterangan |
|---|---|---|---|
email | string | Ya | Email user |
description | string | Ya | Deskripsi masalah (10-1000 karakter) |
Contoh Request
curl -X POST https://fumai.app/api/mobile/v1/auth/report-issue \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"description": "Saya tidak bisa login meskipun sudah pakai email yang benar."
}'const res = await fetch('https://fumai.app/api/mobile/v1/auth/report-issue', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: 'user@example.com',
description: 'Saya tidak bisa login meskipun sudah pakai email yang benar.',
}),
})
const data = await res.json()Response 200
{
"success": true,
"data": {
"message": "Laporan telah dikirim. Tim kami akan menghubungi melalui email."
}
}Rate Limit: 3 per jam (per IP)
Last updated on