If a user logs out from a device the expectation should be that device no longer having any association with the user's account. Any existing push notifications should thefore be removed on server. For this reason tie push notifications to a session, and remove them when the session is deleted.
23 lines
419 B
TypeScript
23 lines
419 B
TypeScript
export interface Account {
|
|
id: number,
|
|
type: "anonymous" | "regular" | "crew" | "admin",
|
|
/** Name of the account. Not present on anonymous accounts */
|
|
name?: string,
|
|
}
|
|
|
|
export interface Subscription {
|
|
type: "push",
|
|
sessionId: number,
|
|
push: PushSubscriptionJSON,
|
|
}
|
|
|
|
export interface Session {
|
|
id: number,
|
|
accountId: number,
|
|
}
|
|
|
|
export interface AccountSession {
|
|
id: number,
|
|
account: Account,
|
|
push: boolean,
|
|
}
|