提交 eee9122c 编写于 作者: R Rachel Macfarlane

accessToken -> getAccessToken, fixes #91570

上级 8d19b698
......@@ -71,7 +71,7 @@ export class GitHubAuthenticationProvider {
id: session.id,
accountName: session.accountName,
scopes: session.scopes,
accessToken: () => Promise.resolve(session.accessToken)
getAccessToken: () => Promise.resolve(session.accessToken)
};
});
} catch (e) {
......@@ -84,7 +84,7 @@ export class GitHubAuthenticationProvider {
private async storeSessions(): Promise<void> {
const sessionData: SessionData[] = await Promise.all(this._sessions.map(async session => {
const resolvedAccessToken = await session.accessToken();
const resolvedAccessToken = await session.getAccessToken();
return {
id: session.id,
accountName: session.accountName,
......@@ -111,7 +111,7 @@ export class GitHubAuthenticationProvider {
const userInfo = await this._githubServer.getUserInfo(token);
return {
id: userInfo.id,
accessToken: () => Promise.resolve(token),
getAccessToken: () => Promise.resolve(token),
accountName: userInfo.accountName,
scopes: scopes
};
......
......@@ -184,7 +184,7 @@ export class AzureActiveDirectoryService {
private convertToSession(token: IToken): vscode.AuthenticationSession {
return {
id: token.sessionId,
accessToken: () => this.resolveAccessToken(token),
getAccessToken: () => this.resolveAccessToken(token),
accountName: token.accountName,
scopes: token.scope.split(' ')
};
......
......@@ -1373,7 +1373,7 @@ export interface RenameProvider {
*/
export interface AuthenticationSession {
id: string;
accessToken(): Thenable<string>;
getAccessToken(): Thenable<string>;
accountName: string;
}
......
......@@ -20,7 +20,7 @@ declare module 'vscode' {
export interface AuthenticationSession {
id: string;
accessToken(): Thenable<string>;
getAccessToken(): Thenable<string>;
accountName: string;
scopes: string[]
}
......
......@@ -25,7 +25,7 @@ export class MainThreadAuthenticationProvider {
return {
id: session.id,
accountName: session.accountName,
accessToken: () => this._proxy.$getSessionAccessToken(this.id, session.id)
getAccessToken: () => this._proxy.$getSessionAccessToken(this.id, session.id)
};
});
}
......@@ -35,7 +35,7 @@ export class MainThreadAuthenticationProvider {
return {
id: session.id,
accountName: session.accountName,
accessToken: () => this._proxy.$getSessionAccessToken(this.id, session.id)
getAccessToken: () => this._proxy.$getSessionAccessToken(this.id, session.id)
};
});
}
......
......@@ -34,7 +34,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi
id: session.id,
accountName: session.accountName,
scopes: session.scopes,
accessToken: async () => {
getAccessToken: async () => {
const isAllowed = await this._proxy.$getSessionsPrompt(
this._provider.id,
this.displayName,
......@@ -45,7 +45,7 @@ export class AuthenticationProviderWrapper implements vscode.AuthenticationProvi
throw new Error('User did not consent to token access.');
}
return session.accessToken();
return session.getAccessToken();
}
};
});
......@@ -137,7 +137,7 @@ export class ExtHostAuthentication implements ExtHostAuthenticationShape {
const sessions = await authProvider.getSessions();
const session = sessions.find(session => session.id === sessionId);
if (session) {
return session.accessToken();
return session.getAccessToken();
}
throw new Error(`Unable to find session with id: ${sessionId}`);
......
......@@ -226,7 +226,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
if (account) {
try {
const token = await account.accessToken();
const token = await account.getAccessToken();
this.authTokenService.setToken(token);
this.authenticationState.set(AuthStatus.SignedIn);
} catch (e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册