@@ -23,12 +23,11 @@ import {
|
||||
scmAuthApiRef,
|
||||
ScmAuthApi,
|
||||
} from '@backstage/integration-react';
|
||||
import { scaffolderApiRef } from '../../../api';
|
||||
import { scaffolderApiRef, ScaffolderApi } from '../../../api';
|
||||
import {
|
||||
SecretsContextProvider,
|
||||
SecretsContext,
|
||||
} from '../../secrets/SecretsContext';
|
||||
import { ScaffolderApi } from '../../..';
|
||||
import { act, fireEvent } from '@testing-library/react';
|
||||
|
||||
describe('RepoUrlPicker', () => {
|
||||
|
||||
@@ -92,11 +92,17 @@ export const RepoUrlPicker = (
|
||||
return;
|
||||
}
|
||||
|
||||
const [host, owner, repoName] = [
|
||||
state.host,
|
||||
state.owner,
|
||||
state.repoName,
|
||||
].map(encodeURIComponent);
|
||||
|
||||
// user has requested that we use the users credentials
|
||||
// so lets grab them using the scmAuthApi and pass through
|
||||
// any additional scopes from the ui:options
|
||||
const { token } = await scmAuthApi.getCredentials({
|
||||
url: `https://${state.host}/${state.owner}/${state.repoName}`,
|
||||
url: `https://${host}/${owner}/${repoName}`,
|
||||
additionalScope: {
|
||||
repoWrite: true,
|
||||
customScopes: requestUserCredentials.additionalScopes,
|
||||
|
||||
Reference in New Issue
Block a user