-
Notifications
You must be signed in to change notification settings - Fork 1
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
(GAP-1984) Adds Navbar for authenticated users #71
Conversation
jest.mock('next/config', () => () => ({ | ||
publicRuntimeConfig: {}, | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is repeated a lot, can setup jest to run it before each test using some config
pages/api/logout/index.ts
Outdated
`session_id=deleted; Path=/; secure; HttpOnly; SameSite=Strict; expires=Thu, 01 Jan 2003 00:00:00 GMT`, | ||
); | ||
const logoutUrl = | ||
process.env.ONE_LOGIN_ENABLED === 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there is a scenario where the user can logout if One Login is disabled. In that case we shouldn't display the logout link
e04be25
to
c44534d
Compare
| (NextIncomingMessage & { cookies: NextApiRequestCookies }) | ||
| NextApiRequest, | ||
) => { | ||
if (!process.env.SESSION_COOKIE_NAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add SESSION_COOKIE_NAME
to .env.example
'Set-Cookie', | ||
`session_id=deleted; Path=/; secure; HttpOnly; SameSite=Strict; expires=Thu, 01 Jan 2003 00:00:00 GMT`, | ||
); | ||
res.redirect(302, process.env.V2_LOGOUT_URL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add this to .env.example
as well
|
||
const logoutAdmin = async (sessionCookie: string) => | ||
axios.delete( | ||
`${process.env.ADMIN_BACKEND_HOST}/logout`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also needs to go in .env.example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all fair
Description
GAP-1984
todo - drill the
isUserLoggedIn
prop into every single page OR remove Layout from every single page and renderLayout
from app entrypointui
![Uploading Screenshot 2023-11-07 at 09.46.43.png…]()Type of change
Please check the relevant options.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes:
Unit Test
Integration Test (if applicable)
End to End Test (if applicable)
Screenshots (if appropriate):
Please attach screenshots of the change if it is a UI change:
Checklist: