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

Restrict app access to anonymous users #31

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

eva-lng
Copy link
Collaborator

@eva-lng eva-lng commented Sep 24, 2024

Type
New Feature
Restrict app access to anonymous users

Description

Whenever an anonymous user visits the site, they only see a prompt message and a Sign In button. In the navbar, only Home and About links are visible.

Changes in the code

A new About view was added to the app. It is accessible from the navbar and has a routing set up in App.jsx. in Layout.jsx the header was adjusted and now displays the app logo and a Sign In / Sign Out button. To the navbar in Layout.jsx a link for About section was added. Links in navbar and content in Home view are rendered conditionally based on whether the user is logged in or not.

Related Issue

closes #30

Acceptance Criteria

  • A new About view is accessible from the navbar
  • The homepage displays only a welcoming message and a prompt to log in or sign up when the user is not authenticated
  • The navbar only shows links to the homepage and about sections for non-authenticated users

Type of Changes

enhancement

Updates

Homepage when logged out

Screenshot 2024-09-24 at 20 56 33

Homepage when logged in

Screenshot 2024-09-24 at 20 58 12

Testing Steps / QA Criteria

  • npm start
  • navigate to the app and log out, only Home and About should be accessible
  • log in, the rest of the app should become accessible

Copy link

Visit the preview URL for this PR (updated for commit 14d5e0c):

https://tcl-78-smart-shopping-list--pr31-el-restricted-access-8egghq7c.web.app

(expires Tue, 01 Oct 2024 18:59:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c781903507c1507075d7a974036959ddeec29c0a

@eva-lng eva-lng requested a review from didemydn September 24, 2024 19:29
Copy link
Collaborator

@didemydn didemydn left a comment

Choose a reason for hiding this comment

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

Thanks Eva!

@didemydn didemydn requested a review from Amaka202 September 24, 2024 19:40
Copy link
Collaborator

@Amaka202 Amaka202 left a comment

Choose a reason for hiding this comment

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

Well done Eva! I totally like the idea yll propose for your app with the about page and yes! to hiding the other links to non signed in users! 💥💚

@GrannyYetta GrannyYetta merged commit 422f1b3 into main Sep 25, 2024
3 checks passed
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.

30. As a user, I want to see a simplified Homepage and navigation bar when not logged in
4 participants