Use the supplied token in the Custom User sign in

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-01-17 11:26:41 +01:00
parent a3667f609c
commit f23146520e
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`,
},