mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
ab3cdb62ac
Summary: This makes two small tweaks based on a user's questions about sharing sites publicly for a self-managed installation: * The support user `support@getgrist.com` is made configurable with `GRIST_SUPPORT_EMAIL`. This came up because only the support user can share material with the special "everyone" user. This restriction was added to avoid spam. * Regardless of public sharing settings, for our SaaS we had decided not to list public sites to anonymous users. That is somewhat a question of taste, so a `GRIST_LIST_PUBLIC_SITES` flag is added to override this choice. Public sharing isn't in a well polished state, and this diff doesn't advance that, in fact it adds a new wrinkle :-/ Test Plan: existing tests pass; manual testing Reviewers: jarek Reviewed By: jarek Subscribers: jarek Differential Revision: https://phab.getgrist.com/D3663
32 lines
1.2 KiB
TypeScript
32 lines
1.2 KiB
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).
|
|
connectId?: string|null, // used by GristConnect to identify user in external provider.
|
|
loginMethod?: 'Google'|'Email + Password'|'External';
|
|
}
|
|
|
|
// User profile including user id and user ref. All information in it should
|
|
// have been validated against database.
|
|
export interface FullUser extends UserProfile {
|
|
id: number;
|
|
ref?: string|null; // Not filled for anonymous users.
|
|
allowGoogleLogin?: boolean; // when present, specifies whether logging in via Google is possible.
|
|
isSupport?: boolean; // set if user is a special support user.
|
|
}
|
|
|
|
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>;
|
|
}
|