import React, {useContext, useEffect} from "react";
import { UserManager } from "oidc-client-ts";
import {ConfigContext} from "../../ConfigProvider";


const Callback = () => {
    const config = useContext(ConfigContext).config;
    useEffect(() => {
        const userManager = new UserManager(config.OIDC_CONFIG);
        userManager.signinRedirectCallback()
            .then(() => {
                window.location.href = "/";
            });
    }, []);

    return <div>Logging in...</div>;
};

export default Callback;