<?php require_once "user.php"; $userKey = $_GET['sso']; $client = new SsoClient(); $response = $client->ssoLogin($userKey); if (!isset($response->error)) { $userService->login($response->data->username, $response->data->email); $userService->flashMessage("Sucessfully logged in!"); } else { $userService->flashMessage("Error: " . $response->error->message); } header('Location: index.php');