Summary: In the past, Cognito sign-ins were intended to give authorization to some AWS services (like SQS); various tokens were stored in the session for this purpose. This is no longer used. Profiles from Cognito now serve a limited purpose: first-time initialization of name and picture, and keeping track of which login method was used. For these remaining needs, ScopedSession is sufficient. Test Plan: Existing test pass. Tested manually that logins work with Google and Email + Password. Tested manually that on a clean database, name and picture are picked up from a Google Login. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2907pull/9/head
parent
f079ffdcb3
commit
869b2f00ec
@ -1,13 +0,0 @@
|
||||
import {UserProfile} from 'app/common/LoginSessionAPI';
|
||||
import {Client} from 'app/server/lib/Client';
|
||||
|
||||
export interface ILoginSession {
|
||||
clients: Set<Client>;
|
||||
getEmail(): Promise<string>;
|
||||
getSessionProfile(): Promise<UserProfile|null>;
|
||||
// Log out
|
||||
clearSession(): Promise<void>;
|
||||
|
||||
// For testing only. If no email address, profile is wiped, otherwise it is set.
|
||||
testSetProfile(profile: UserProfile|null): Promise<void>;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
import {UserProfile} from 'app/common/LoginSessionAPI';
|
||||
import {Client} from 'app/server/lib/Client';
|
||||
import {ILoginSession} from 'app/server/lib/ILoginSession';
|
||||
|
||||
export class LoginSession implements ILoginSession {
|
||||
public clients: Set<Client> = new Set();
|
||||
public async getEmail() {
|
||||
return process.env.GRIST_DEFAULT_EMAIL || 'anon@getgrist.com';
|
||||
}
|
||||
public async getSessionProfile() {
|
||||
return {
|
||||
name: await this.getEmail(),
|
||||
email: await this.getEmail(),
|
||||
};
|
||||
}
|
||||
public async clearSession(): Promise<void> {
|
||||
// do nothing
|
||||
}
|
||||
public async testSetProfile(profile: UserProfile|null): Promise<void> {
|
||||
// do nothing
|
||||
}
|
||||
}
|
Loading…
Reference in new issue