@spfn/auth 0.3.0-beta.24 → 0.3.0-beta.25

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.
@@ -0,0 +1,20 @@
1
+ CREATE TABLE "spfn_auth"."mfa_challenges" (
2
+ "id" bigserial PRIMARY KEY,
3
+ "user_id" bigint NOT NULL,
4
+ "challenge_hash" text NOT NULL,
5
+ "key_id" text NOT NULL,
6
+ "channel" text NOT NULL,
7
+ "key_epoch" integer NOT NULL,
8
+ "attempts" integer DEFAULT 0 NOT NULL,
9
+ "expires_at" timestamp with time zone NOT NULL,
10
+ "verified_at" timestamp with time zone,
11
+ "login_event" jsonb,
12
+ "created_at" timestamp with time zone DEFAULT now() NOT NULL,
13
+ "updated_at" timestamp with time zone DEFAULT now() NOT NULL
14
+ );
15
+ --> statement-breakpoint
16
+ ALTER TABLE "spfn_auth"."user_public_keys" ADD COLUMN "pending_mfa_challenge_id" bigint;--> statement-breakpoint
17
+ CREATE UNIQUE INDEX "mfa_challenge_hash_idx" ON "spfn_auth"."mfa_challenges" ("challenge_hash");--> statement-breakpoint
18
+ CREATE INDEX "mfa_challenges_expires_at_idx" ON "spfn_auth"."mfa_challenges" ("expires_at");--> statement-breakpoint
19
+ ALTER TABLE "spfn_auth"."mfa_challenges" ADD CONSTRAINT "mfa_challenges_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "spfn_auth"."users"("id") ON DELETE CASCADE;--> statement-breakpoint
20
+ ALTER TABLE "spfn_auth"."mfa_challenges" ADD CONSTRAINT "mfa_challenges_key_id_user_public_keys_key_id_fkey" FOREIGN KEY ("key_id") REFERENCES "spfn_auth"."user_public_keys"("key_id") ON DELETE CASCADE;