Skip to content

Feature/admin login 2#6

Open
DinMon wants to merge 4 commits into
masterfrom
feature/admin-login-2
Open

Feature/admin login 2#6
DinMon wants to merge 4 commits into
masterfrom
feature/admin-login-2

Conversation

@DinMon
Copy link
Copy Markdown
Owner

@DinMon DinMon commented Nov 20, 2020

Use Firebase authentication for admin login and normal user.

For a normal user, the password has been hard-coded from the front-end and saved to Firebase Auth. May have potential security issues.

Add a pointer for cards which are yet to be flipped.

Comment thread react-app/src/App.js
Comment on lines +19 to +26
authListener(signUserIn)
}, [])

function signUserIn(user) {
setUserLoggedIn(user)
if (user) {
history.replace('/')
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like some issues with auto indent? Or maybe it is Github's problem?
I see like 8 spaces for one indent level 🤔

Comment thread react-app/src/App.js
Comment on lines +37 to +41
{userLoggedIn ? (
<DashboardPage />
): (
<Redirect to="/login" />
)}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's discuss this one over the meeting - dynamic and declarative routing (especially redirects) like the ones in React as super great in day to day use, but they have some scalability issues (i.e. long term there are some down sides using this approach), so I want to address them specifically.

Copy link
Copy Markdown
Collaborator

@VitalyKrenel VitalyKrenel Nov 28, 2020

Choose a reason for hiding this comment

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

  • Discuss routing in React application

import RoundedAvatar from '../components/RoundedAvatar'
import LoadingAnimation from '../components/LoadingAnimation'
import firebase from 'firebase'
import firebase from '../firebase'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right now one of the third-party dependencies is leaking into your app's codebase. In such a case, it would be difficult to remove the dependency or replace it (more often scenario). Let's discuss it in the meeting

Copy link
Copy Markdown
Collaborator

@VitalyKrenel VitalyKrenel Nov 28, 2020

Choose a reason for hiding this comment

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

  • Discuss abstraction over dependencies

<PasswordAvatar user={adminUser} onBack={() => setAdminUser(null)}/>
) : (
<div className='users-container'>
{users && users.map((user) =>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't users be an empty array in the case there are no users?

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.

2 participants