Skip to content

Commit

Permalink
Fix verify response for email/sms/totp (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfisher authored Oct 17, 2024
1 parent 607adbb commit a7c04e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@authsignal/browser",
"version": "1.0.0-alpha1",
"version": "1.0.0",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/email.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {EmailApiClient} from "./api/email-api-client";
import {ChallengeResponse, EnrollResponse, VerifyResponse} from "./api/types/shared";
import {ChallengeResponse, EnrollResponse} from "./api/types/shared";
import {handleApiResponse} from "./helpers";
import {TokenCache} from "./token-cache";
import {AuthsignalResponse} from "./types";
import {AuthsignalResponse, VerifyResponse} from "./types";

type EmailOptions = {
baseUrl: string;
Expand Down
4 changes: 2 additions & 2 deletions src/sms.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {SmsApiClient} from "./api/sms-api-client";
import {ChallengeResponse, EnrollResponse, VerifyResponse} from "./api/types/shared";
import {ChallengeResponse, EnrollResponse} from "./api/types/shared";
import {handleApiResponse} from "./helpers";
import {TokenCache} from "./token-cache";
import {AuthsignalResponse} from "./types";
import {AuthsignalResponse, VerifyResponse} from "./types";

type SmsOptions = {
baseUrl: string;
Expand Down
2 changes: 1 addition & 1 deletion src/totp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {TotpApiClient} from "./api/totp-api-client";
import {VerifyResponse} from "./api/types/shared";
import {VerifyResponse} from "./types";
import {EnrollTotpResponse} from "./api/types/totp";
import {handleApiResponse} from "./helpers";
import {TokenCache} from "./token-cache";
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ export type AuthsignalResponse<T> = {
error?: string;
data?: T;
};

export type VerifyResponse = {
isVerified: boolean;
token?: string;
failureReason?: string;
};

0 comments on commit a7c04e5

Please sign in to comment.