mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
90d3ee037a
Summary: New language selector on the Account page for logged-in users. New icon for switching language for an anonymous user. For anonymous users, language is stored in a cookie grist_user_locale. Language is stored in user settings for authenticated users and takes precedence over what is stored in the cookie. Test Plan: New tests Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3766
33 lines
1.3 KiB
TypeScript
33 lines
1.3 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';
|
|
locale?: string|null;
|
|
}
|
|
|
|
// 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>;
|
|
}
|