public async Task <IActionResult> OnGet()
        {
            if (!User.Identity.IsAuthenticated ||
                User.GetConnectionId() == null)
            {
                return(await CreateNewConnection());
            }
            else
            {
                ConnectionStateModel connection = await _passportService.GetConnection(User.GetConnectionId());

                if (connection.State == ConnectionState.Connected)
                {
                    if (!string.IsNullOrEmpty(ReturnUrl) && Url.IsLocalUrl(ReturnUrl))
                    {
                        return(Redirect(ReturnUrl));
                    }
                    return(RedirectToPage("./ConnectionProof"));
                }
                else
                {
                    return(await CreateNewConnection());
                }
            }
        }
        public async Task OnGet()
        {
            string connectionId = User.GetConnectionId();

            if (connectionId != null)
            {
                Connection = await _passportService.GetConnection(connectionId);
            }
        }
        public async Task <IActionResult> OnGetStatusAsync(string id)
        {
            ConnectionStateModel connection = await _passportService.GetConnection(id);

            if (connection.State == ConnectionState.Connected)
            {
                return(new JsonResult(true));
            }
            else
            {
                return(new JsonResult(false));
            }
        }
        public async Task <IActionResult> OnGetContinueAsync(string id)
        {
            string connectionId             = id;
            ConnectionStateModel connection = await _passportService.GetConnection(connectionId);

            if (connection.State == ConnectionState.Connected)
            {
                await HttpContext.Login(connection.Id);

                return(RedirectToPage("./Index")); // TODO jumason : Use ReturnUrl instead if set, meaning we came from a proof/credential page request?
            }
            else
            {
                Message = "Error: The user declined the connection.";
                return(Page());
            }
        }