Skip to content

Commit

Permalink
chore: formatting og linting
Browse files Browse the repository at this point in the history
  • Loading branch information
eskilgh authored Oct 24, 2024
1 parent b3d366f commit 4a6192a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .yarn/releases/yarn-4.4.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
6 changes: 3 additions & 3 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"execMap": {
"ts": "ts-node"
}
"execMap": {
"ts": "ts-node"
}
}
6 changes: 5 additions & 1 deletion src/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ export default function Error({ error, reset }: Props): ReactElement {
</Heading>
<BodyLong spacing>
Det har oppstått et intern feil i applikasjonen. Dersom feiler fortsetter si gjerne i fra på{' '}
<a href="https://nrk.enterprise.slack.com/archives/C07TCLY8T2Q" target="_blank" rel="noopener noreferrer">
<a
href="https://nrk.enterprise.slack.com/archives/C07TCLY8T2Q"
target="_blank"
rel="noopener noreferrer"
>
#helsesjekk-bot
</a>{' '}
så vi får fikset feilen raskest mulig.
Expand Down
6 changes: 4 additions & 2 deletions src/auth/authentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ import { raise } from '../utils/ts-utils'
import { fakeToken } from './fake-token'
import { getMembersOf } from './ms-graph'

/* eslint-disable @typescript-eslint/no-unused-vars */

/**
* Validates the wonderwall token according to nais.io. Should only actually redirect if the token has expired.
*/
export async function validateWonderwallToken(redirectPath: string): Promise<void> {
const requestHeaders = headers()
// const requestHeaders = headers()

if (isLocal) {
logger.warn('Is running locally, skipping RSC auth')
return
}

// const token = getToken(requestHeaders)
// if (!token) {
// logger.warn('Found no token, redirecting to login, why was this not picked up by middleware.ts?')
Expand Down
11 changes: 7 additions & 4 deletions src/auth/ms-graph.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { headers } from 'next/headers'
import { logger } from '@navikt/next-logger'
// import { headers } from 'next/headers'
// import { logger } from '@navikt/next-logger'

import { isLocal } from '../utils/env'

import { fakeMembersOfResponse } from './fake-members-of-response'
import { getUserToken } from './authentication'
// import { getUserToken } from './authentication'

/* eslint-disable @typescript-eslint/no-unused-vars */

export async function getMembersOf(): Promise<
MsGraphGroupsResponse | { error: string; status?: number; statusText?: string }
Expand All @@ -13,7 +15,8 @@ export async function getMembersOf(): Promise<
return fakeMembersOfResponse
}

throw Error("Integration with azure entra ID not configured yet")
// TODO: integrate with entra ID
return fakeMembersOfResponse
/* const token = getUserToken(headers())
const tokenSet = await requestOboToken(token, 'https://graph.microsoft.com/.default')
if (!tokenSet.ok) {
Expand Down
9 changes: 7 additions & 2 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ function Footer(): ReactElement {
/>
<div className="pl-4 mt-4">
<Heading size="medium" level="2">
Helsesjekk er basert på åpen kildekode originalt utviklet av NAV. For NRK er utvikling og vedlikehold gjort av Påloggingsteamet.
Helsesjekk er basert på åpen kildekode originalt utviklet av NAV. For NRK er utvikling og
vedlikehold gjort av Påloggingsteamet.
</Heading>
<BodyShort>
Feedback og bugs kan rapporteres på slack på{' '}
<a href="https://nrk.enterprise.slack.com/archives/C07TCLY8T2Q" target="_blank" rel="noopener noreferrer">
<a
href="https://nrk.enterprise.slack.com/archives/C07TCLY8T2Q"
target="_blank"
rel="noopener noreferrer"
>
#helsesjekk-bot
</a>
</BodyShort>
Expand Down

0 comments on commit 4a6192a

Please sign in to comment.