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

(GAP-1984) Adds Navbar for authenticated users #71

Merged
merged 20 commits into from
Nov 9, 2023

Conversation

john-tco
Copy link
Contributor

@john-tco john-tco commented Nov 6, 2023

Description

GAP-1984

todo - drill the isUserLoggedIn prop into every single page OR remove Layout from every single page and render Layout from app entrypoint

ui

Screenshot 2023-11-07 at 09 45 51 Screenshot 2023-11-07 at 09 46 15 ![Uploading Screenshot 2023-11-07 at 09.46.43.png…]()

Type of change

Please check the relevant options.

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

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:

  • If I have listed dependencies above, I have ensured that they are present in the target branch.
  • I have performed a self-review of my code.
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the documentation where applicable.
  • I have ran cypress tests and they all pass locally.

@john-tco john-tco changed the title initial (GAP-1984) Adds Navbar for authenticated users Nov 7, 2023
@john-tco john-tco marked this pull request as ready for review November 7, 2023 09:26
Comment on lines 24 to 26
jest.mock('next/config', () => () => ({
publicRuntimeConfig: {},
}));
Copy link
Contributor

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

`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'
Copy link
Contributor

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

@john-tco john-tco force-pushed the feature/GAP-1984-auth-nav branch from e04be25 to c44534d Compare November 8, 2023 09:10
dylanwrightCO
dylanwrightCO previously approved these changes Nov 8, 2023
| (NextIncomingMessage & { cookies: NextApiRequestCookies })
| NextApiRequest,
) => {
if (!process.env.SESSION_COOKIE_NAME) {
Copy link
Contributor

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);
Copy link
Contributor

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`,
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all fair

@john-tco john-tco merged commit 63237c3 into develop Nov 9, 2023
2 checks passed
@john-tco john-tco deleted the feature/GAP-1984-auth-nav branch November 9, 2023 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants