NHS Login
NHS OpenID Connect scope
NHS Login button on a front end client and showing the logged in user
<a href="http://localhost/auth/nhs-login">NHS Login</a>import { useRouter } from 'next/router';
import jwt from 'jsonwebtoken';
const WithStaticProps = () => {
const router = useRouter();
const { token } = router.query;
const decoded = jwt.decode(token);
return (
<div>
<h1>Login successful</h1>
<p>Received a JWT</p>
{decoded && (
<>
<p>id: {decoded.id}</p>
<p>name: {decoded.name}</p>
<p>email: {decoded.email}</p>
<p>role: {decoded.role}</p>
</>
)}
<p>
<Link href="/">
<a>Go home</a>
</Link>
</p>
</div>
);
};
export default WithStaticProps;Last updated