chore: reworking the auth providers to decorate the identity from the token that is returned from the different providers

Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-12-01 16:02:09 +01:00
parent 29d0b45c6a
commit 39645e56ac
11 changed files with 89 additions and 48 deletions
@@ -30,7 +30,7 @@ import {
import { commonProvider } from './commonProvider';
import { guestProvider } from './guestProvider';
import { customProvider } from './customProvider';
import { IdentityApiProxy } from './IdentityApiProxy';
import { IdentityApiSignOutProxy } from './IdentityApiSignOutProxy';
const PROVIDER_STORAGE_KEY = '@backstage/core:SignInPage:provider';
@@ -92,7 +92,7 @@ export const useSignInProviders = (
const handleWrappedResult = useCallback(
(identityApi: IdentityApi) => {
onSignInSuccess(
IdentityApiProxy.from({
IdentityApiSignOutProxy.from({
identityApi,
signOut: async () => {
localStorage.removeItem(PROVIDER_STORAGE_KEY);