feat(ST-1135): UA-redirect bij login — phone naar /m/* (T-322/T-323/T-324)
- lib/user-agent.ts (nieuw): isPhoneUA() — Mobi-substring heuristiek (telefoons hebben Mobi, tablets/desktop niet) - actions/auth.ts loginAction: leest user-agent header na session.save(); phone-UA + actief product → /m/products/[id]/solo, zonder → /m/settings; tablet/desktop/null-UA → /dashboard (ongewijzigd) - Tests: 7 helper-cases + 6 loginAction-paden incl. demo-user Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
479a502dfd
commit
13ab53ab8d
4 changed files with 138 additions and 0 deletions
8
lib/user-agent.ts
Normal file
8
lib/user-agent.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// PBI-11 / ST-1135: detecteert telefoon-UA's voor login-redirect.
|
||||
// Heuristiek: 'Mobi' in de UA-string. Zit in Android Chrome en iPhone Safari
|
||||
// Mobile, NIET in iPad of Android-tablet — exact wat we willen voor de
|
||||
// `/m/*`-mobile-shell (alleen telefoons, geen tablets).
|
||||
|
||||
export function isPhoneUA(ua: string | null): boolean {
|
||||
return ua !== null && ua.includes('Mobi')
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue