0.3.22 - PINs
This commit is contained in:
@@ -945,10 +945,19 @@ CREATE TABLE IF NOT EXISTS viewers (
|
||||
colour TEXT NOT NULL DEFAULT '',
|
||||
kind TEXT NOT NULL, -- main | shadow
|
||||
pin_hash BYTEA,
|
||||
pin_value TEXT,
|
||||
pin_failed_attempts INTEGER NOT NULL DEFAULT 0,
|
||||
pin_locked_until TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
-- Failed PINs are kept with the viewer rather than in the television. This survives
|
||||
-- reinstalls and gives every device sharing a profile the same brute-force budget.
|
||||
ALTER TABLE viewers ADD COLUMN IF NOT EXISTS pin_failed_attempts INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE viewers ADD COLUMN IF NOT EXISTS pin_locked_until TIMESTAMPTZ;
|
||||
ALTER TABLE viewers ADD COLUMN IF NOT EXISTS pin_value TEXT;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS viewers_account_idx ON viewers (emby_user_id, created_at);
|
||||
|
||||
-- One main viewer per account, enforced rather than assumed: the main viewer is what a
|
||||
|
||||
Reference in New Issue
Block a user