Merge pull request #15792 from backstage/freben/custom-token

Use the supplied token in the Custom User sign in
This commit is contained in:
Fredrik Adelöw
2023-01-17 11:55:59 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Ensure that the "Custom User" sign-in makes use of supplied custom tokens, if any
@@ -69,10 +69,11 @@ const Component: ProviderComponent = ({ onSignInSuccess }) => {
const { errors } = formState;
const handleResult = ({ userId }: Data) => {
const handleResult = ({ userId, idToken }: Data) => {
onSignInSuccess(
UserIdentity.fromLegacy({
userId,
getIdToken: idToken !== undefined ? async () => idToken : undefined,
profile: {
email: `${userId}@example.com`,
},