feeef 0.9.3 → 0.9.4

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/build/index.js CHANGED
@@ -612,6 +612,29 @@ var UserRepository = class extends ModelRepository {
612
612
  };
613
613
  return this.auth;
614
614
  }
615
+ /**
616
+ * Generates a short-lived, single-use Feeef auth code for cross-device / QR login.
617
+ *
618
+ * POST `/users/auth/code` (auth required).
619
+ */
620
+ async createAuthCode(options = {}) {
621
+ const res = await this.client.post(`/${this.resource}/auth/code`, {
622
+ redirect: options.redirect
623
+ });
624
+ return res.data;
625
+ }
626
+ /**
627
+ * Signs in using a one-time Feeef auth code (OAuth-like semantics).
628
+ *
629
+ * POST `/users/auth/code/consume` (public). On success it returns a bearer token and user.
630
+ */
631
+ async signinWithCode(options) {
632
+ const res = await this.client.post(`/${this.resource}/auth/code/consume`, {
633
+ authCode: options.authCode
634
+ });
635
+ this.auth = res.data;
636
+ return this.auth;
637
+ }
615
638
  /**
616
639
  * Signs out the currently authenticated user.
617
640
  * Deletes the token on the server and clears local auth state.