refactor: use OAuthApiCreateOptions

This commit is contained in:
Jesko Steinberg
2020-10-12 15:26:31 +02:00
parent 34a94c9a58
commit c5bab94aba
10 changed files with 73 additions and 111 deletions
+29
View File
@@ -0,0 +1,29 @@
---
'@backstage/core-api': patch
---
Updated the AuthApi `.create` methods to configure the default scope of the corresponding Auth Api. As a result the
default scope is configurable when overwriting the Core Api in the app.
```
GithubAuth.create({
discoveryApi,
oauthRequestApi,
defaultScopes: ['read:user', 'repo'],
}),
```
Replaced redundant CreateOptions of each Auth Api with the OAuthApiCreateOptions type.
```
export type OAuthApiCreateOptions = AuthApiCreateOptions & {
oauthRequestApi: OAuthRequestApi;
defaultScopes?: string[];
};
export type AuthApiCreateOptions = {
discoveryApi: DiscoveryApi;
environment?: string;
provider?: AuthProvider & { id: string };
};
```