Merge pull request #11927 from backstage/rugvip/getting-started

docs: update sign-in page example in getting started docs
This commit is contained in:
Johan Haals
2022-06-09 08:49:17 +02:00
committed by GitHub
+13 -15
View File
@@ -164,27 +164,25 @@ Open `packages/app/src/App.tsx` and below the last `import` line, add:
```typescript
import { githubAuthApiRef } from '@backstage/core-plugin-api';
import { SignInProviderConfig, SignInPage } from '@backstage/core-components';
const githubProvider: SignInProviderConfig = {
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
apiRef: githubAuthApiRef,
};
```
Search for `const app = createApp({` in this file, and below `apis,` add:
```typescript
components: {
SignInPage: props => (
<SignInPage
{...props}
auto
provider={githubProvider}
/>
),
},
SignInPage: props => (
<SignInPage
{...props}
auto
provider={{
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
apiRef: githubAuthApiRef,
}}
/>
),
},
```
> Since [v1.1.0](https://github.com/backstage/backstage/releases/tag/v1.1.0-next.3), you must provide an [explicit sign-in resolver](../auth/identity-resolver.md).