oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1-- Framework session hooks belong only in the boot schema.
2CREATE TRIGGER equipo_native_session_delete AFTER DELETE ON sessions BEGIN
3 UPDATE person_devices SET revoked_at=CURRENT_TIMESTAMP, revision=revision+1, result_cipher='', begin_cipher='' WHERE native_session_hash=OLD.token_hash AND revoked_at IS NULL;
4 DELETE FROM push_registrations WHERE credential IN (SELECT id FROM person_devices WHERE native_session_hash=OLD.token_hash);
5 DELETE FROM push_activities WHERE credential IN (SELECT id FROM person_devices WHERE native_session_hash=OLD.token_hash);
6 UPDATE push_outbox SET state='dropped',reason='forgotten',lease_until=NULL WHERE state='pending' AND credential IN (SELECT id FROM person_devices WHERE native_session_hash=OLD.token_hash);
7END;
8CREATE TRIGGER equipo_native_link_delete BEFORE DELETE ON home_identity_links BEGIN
9 DELETE FROM sessions WHERE method='home-assertion-native' AND subject=OLD.subject;
10END;
11