@qrauth/web-components 0.3.0 → 0.4.1

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/dist/twofa.d.ts CHANGED
@@ -23,6 +23,12 @@ import { QRAuthElement } from './base.js';
23
23
  * alternative same-device verification path and the
24
24
  * component is only there as the cross-device scan
25
25
  * option.
26
+ * redirect-uri — Where the QRAuth hosted approval page should send
27
+ * the user after they tap Approve on mobile. Must
28
+ * match one of the app's registered `redirectUrls`.
29
+ * Without this, the mobile-CTA new tab ends on a
30
+ * "you can close this page" dead end. See
31
+ * <qrauth-login> JSDoc for full semantics.
26
32
  *
27
33
  * Events (bubbles + composed, cross shadow-DOM):
28
34
  * qrauth:verified — detail: { sessionId, user, signature }
@@ -41,11 +47,14 @@ export declare class QRAuthTwoFA extends QRAuthElement {
41
47
  private _codeVerifier;
42
48
  private _status;
43
49
  private _expiresAt;
50
+ private _currentQrUrl;
44
51
  private _timerInterval;
45
52
  private _pollTimeout;
46
53
  get sessionToken(): string | null;
47
54
  get scopes(): string;
48
55
  get autoStart(): boolean;
56
+ /** See <qrauth-login>.redirectUri for semantics. */
57
+ get redirectUri(): string | null;
49
58
  get forceMode(): 'mobile' | 'desktop' | 'auto';
50
59
  get mobileFallbackOnly(): boolean;
51
60
  connectedCallback(): void;
@@ -73,6 +82,11 @@ export declare class QRAuthTwoFA extends QRAuthElement {
73
82
  * The existing polling loop in _beginPolling picks up SCANNED / APPROVED
74
83
  * transitions from the server once the user completes the flow there, so
75
84
  * qrauth:verified fires unchanged.
85
+ *
86
+ * The `dr=1` query flag tells the hosted approval page that this is a
87
+ * same-device click (not a cross-device QR scan), and that the
88
+ * post-approval redirect to redirectUrl should fire. The QR matrix
89
+ * encodes the bare /a/:token URL, so a scanner cannot carry this flag.
76
90
  */
77
91
  private _openApprovalPage;
78
92
  private _startAuth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrauth/web-components",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "QRAuth Web Components — drop-in authentication elements",
5
5
  "type": "module",
6
6
  "main": "dist/qrauth-components.js",
@@ -49,7 +49,11 @@
49
49
  "type": "git",
50
50
  "url": "git+https://github.com/qrauth-io/qrauth.git"
51
51
  },
52
+ "dependencies": {
53
+ "qrcode": "1.5.4"
54
+ },
52
55
  "devDependencies": {
56
+ "@types/qrcode": "^1.5.5",
53
57
  "esbuild": "^0.24.0",
54
58
  "happy-dom": "^15.11.7",
55
59
  "typescript": "^5.7.0",