Rename setUser
to restoreUser
.
This commit is contained in:
parent
e69c8dd3fc
commit
2324f08d69
@ -79,7 +79,7 @@ class Backend {
|
|||||||
if (this.user) { return this.user; }
|
if (this.user) { return this.user; }
|
||||||
const stored = this.authStore && this.authStore.retrieve();
|
const stored = this.authStore && this.authStore.retrieve();
|
||||||
if (stored && stored.backendName === this.backendName) {
|
if (stored && stored.backendName === this.backendName) {
|
||||||
return Promise.resolve(this.implementation.setUser(stored)).then((user) => {
|
return Promise.resolve(this.implementation.restoreUser(stored)).then((user) => {
|
||||||
const newUser = {...user, backendName: this.backendName};
|
const newUser = {...user, backendName: this.backendName};
|
||||||
// return confirmed/rehydrated user object instead of stored
|
// return confirmed/rehydrated user object instead of stored
|
||||||
this.authStore.store(newUser);
|
this.authStore.store(newUser);
|
||||||
|
@ -43,7 +43,7 @@ export default class GitGateway extends GitHubBackend {
|
|||||||
AuthenticationPage.authClient = this.authClient;
|
AuthenticationPage.authClient = this.authClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
setUser() {
|
restoreUser() {
|
||||||
const user = this.authClient && this.authClient.currentUser();
|
const user = this.authClient && this.authClient.currentUser();
|
||||||
if (!user) return Promise.reject();
|
if (!user) return Promise.reject();
|
||||||
return this.authenticate(user);
|
return this.authenticate(user);
|
||||||
|
@ -23,7 +23,7 @@ export default class GitHub {
|
|||||||
return AuthenticationPage;
|
return AuthenticationPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
setUser(user) {
|
restoreUser(user) {
|
||||||
return this.authenticate(user);
|
return this.authenticate(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ export default class TestRepo {
|
|||||||
return AuthenticationPage;
|
return AuthenticationPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
setUser(user) {
|
restoreUser(user) {
|
||||||
return this.authenticate(user);
|
return this.authenticate(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user