Files
2026-11-16 17:26:44 -08:00

16 lines
579 B
SQL

-- One-use PKCE grants and revocable, knowledge-only client sessions. No plaintext secrets.
CREATE TABLE IF NOT EXISTS eddy_sso_codes (
code_hash text PRIMARY KEY,
email text NOT NULL,
challenge text NOT NULL,
redirect_uri text NOT NULL,
expires_at bigint NOT NULL
);
CREATE INDEX IF NOT EXISTS eddy_sso_codes_expiry ON eddy_sso_codes (expires_at);
CREATE TABLE IF NOT EXISTS eddy_sso_sessions (
token_hash text PRIMARY KEY,
email text NOT NULL,
expires_at bigint NOT NULL
);
CREATE INDEX IF NOT EXISTS eddy_sso_sessions_expiry ON eddy_sso_sessions (expires_at);