mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
5ef889addd
Summary: This moves enough server material into core to run a home server. The data engine is not yet incorporated (though in manual testing it works when ported). Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2552
28 lines
940 B
TypeScript
28 lines
940 B
TypeScript
// User profile info for the user. When using Cognito, it is fetched during login.
|
|
export interface UserProfile {
|
|
email: string;
|
|
name: string;
|
|
picture?: string|null; // when present, a url to a public image of unspecified dimensions.
|
|
anonymous?: boolean; // when present, asserts whether user is anonymous (not authorized).
|
|
loginMethod?: 'Google'|'Email + Password';
|
|
}
|
|
|
|
// User profile including user id. All information in it should
|
|
// have been validated against database.
|
|
export interface FullUser extends UserProfile {
|
|
id: number;
|
|
}
|
|
|
|
export interface LoginSessionAPI {
|
|
/**
|
|
* Logs out by clearing all data in the session store besides the session cookie itself.
|
|
* Broadcasts the logged out state to all clients.
|
|
*/
|
|
logout(): Promise<void>;
|
|
|
|
/**
|
|
* Replaces the user profile object in the session and broadcasts the new profile to all clients.
|
|
*/
|
|
updateProfile(profile: UserProfile): Promise<void>;
|
|
}
|