@nauticana/sail 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/model/auth.ts +13 -6
- package/src/service/auth.service.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nauticana/sail",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Metadata-driven Angular component library for CRUD admin frontends backed by the keel Go backend. Tables, forms, navigation, OTP/2FA/social auth, billing.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"files": [
|
package/src/model/auth.ts
CHANGED
|
@@ -43,19 +43,26 @@ export interface SignupConsent {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// ── Phone / email OTP ──
|
|
46
|
-
// `contactType`
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
46
|
+
// `contactType` selects the OTP delivery channel. As of keel v0.5.11
|
|
47
|
+
// the backend honors this field directly: 'phone' (default — `contact`
|
|
48
|
+
// is normalized to E.164 and OTP goes via SMS) or 'email' (`contact`
|
|
49
|
+
// is lowercased + trimmed and OTP goes via the keel MailClient).
|
|
50
|
+
// Older keel deployments ignore anything other than phone — pin the
|
|
51
|
+
// consumer's go.mod when this matters.
|
|
51
52
|
export type OtpContactType = 'phone' | 'email';
|
|
52
53
|
export type OtpPurpose = 'login' | 'register' | 'verify';
|
|
53
54
|
|
|
54
55
|
export interface OtpRequest {
|
|
55
56
|
contact: string;
|
|
56
|
-
contactType?: OtpContactType; //
|
|
57
|
+
contactType?: OtpContactType; // 'phone' (default) | 'email'
|
|
57
58
|
purpose?: OtpPurpose;
|
|
58
59
|
defaultRegion?: string; // ISO country hint for phone normalization
|
|
60
|
+
// The OTHER contact the user supplied at signup, persisted on the
|
|
61
|
+
// new user_account row even though it isn't being OTP-verified at
|
|
62
|
+
// this step. When contactType='email', this is the user's phone;
|
|
63
|
+
// when contactType='phone', this is the user's email. Optional —
|
|
64
|
+
// omit for login flows (only registration creates the row).
|
|
65
|
+
secondaryContact?: string;
|
|
59
66
|
policyType?: string;
|
|
60
67
|
policyVersion?: string;
|
|
61
68
|
policyRegion?: string;
|
|
@@ -263,8 +263,12 @@ export abstract class BaseAuthService {
|
|
|
263
263
|
* numbers by comparing 200 vs 404.
|
|
264
264
|
*/
|
|
265
265
|
sendOtp(req: OtpRequest): Observable<OtpResponse> {
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
// Send the request as-is — `contactType` is now a real backend
|
|
267
|
+
// field (keel v0.5.11+) that selects the SMS-vs-email dispatch
|
|
268
|
+
// channel. The pre-v0.5.11 strip-before-post workaround was
|
|
269
|
+
// removed when email-OTP support landed in keel/handler/
|
|
270
|
+
// otp_handler.go.
|
|
271
|
+
return this.http.post<OtpResponse>(this.otpSendUrl, req);
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
resendOtp(otpToken: string, purpose?: OtpRequest['purpose']): Observable<{ status: string }> {
|