portal-www
v1.74.0
Published
Nova Portal Website. Based on Next starter by Ueno
Maintainers
Readme
portal-www
Nova customer portal 👨🏻💻 This project uses nova-graphql. Single sign-on via connect.nova.is (see here)
Development
This project uses @nova-hf/ui (npm). Please refer to the readme for logging into the shared nova-dev npm account to get access to package.
After logging in via npm and added .env variables:
> yarn install
> yarn dev
# Dev server should now be runnion on localhost:4000Features
This project was bootstrapped with create-ueno-app - next.js starter-kit. Most notably we use use:
- React for view
- Next.js - the framework brings routing, SSR, codesplitting and more.
- Apollo client 3.x for graphql
- Mobx with mobx-react for application state management
- CSS modules for 💅
- Konfetti: the UI component library
- Typescript
- XState
Authentication flow
This application implements OAuth 2.0 authorization code flow - authneticating via connect.nova.is. This flow is also well described here.
Note: we do not use refresh tokens in the application. We reauthenticate upon expiration.
Handling expired tokens
We handle token expirations on three places.
withApollo.tsx
This hoc wrapps the application providing it with the apollo client.
For expired tokens this triggers an authehntication when
- A page is server side renders
- when routing client side
apolloClient.ts
This graphql client does all client side data fetching.
For expired tokens this triggers an authentication when
- Data is being queried or mutated from the client
AuthorizationStatus.tsx
This component follows the validity of the token on a 30s interval and displays a label that the application has lost authentication when relevant.
