Add StreamPixels managed auth seams
This commit is contained in:
parent
5ef94bb725
commit
f22db66d64
15 changed files with 589 additions and 26 deletions
|
|
@ -289,6 +289,22 @@ export class PostgresStore implements HeimdallStore {
|
|||
return result.rowCount ? mapLinkedIdentityRow(expectRow(result.rows[0], "findStoredLinkedIdentity")) : null;
|
||||
}
|
||||
|
||||
async findStoredLinkedIdentityForAccount(accountId: string, provider: Provider): Promise<StoredLinkedIdentity | null> {
|
||||
const result = await this.pool.query<LinkedIdentityRow>(
|
||||
`
|
||||
SELECT *
|
||||
FROM linked_identities
|
||||
WHERE account_id = $1
|
||||
AND provider = $2
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT 1
|
||||
`,
|
||||
[accountId, provider]
|
||||
);
|
||||
|
||||
return result.rowCount ? mapLinkedIdentityRow(expectRow(result.rows[0], "findStoredLinkedIdentityForAccount")) : null;
|
||||
}
|
||||
|
||||
async upsertLinkedIdentity(input: UpsertLinkedIdentityInput): Promise<StoredLinkedIdentity> {
|
||||
const id = input.id ?? randomUUID();
|
||||
const result = await this.pool.query<LinkedIdentityRow>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue