Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting #3

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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