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

implemented auth [unfinished] #5

Merged
merged 3 commits into from
Dec 30, 2023
Merged

implemented auth [unfinished] #5

merged 3 commits into from
Dec 30, 2023

Conversation

kristenyee
Copy link
Contributor

closes #3

import { logInWithEmailAndPassword, useNavigate } from '../utils/auth_utils';
// import { logInWithEmailAndPassword , signInWithGoogle, useNavigate } from '../utils/auth_utils';

const Login = ({ cookies }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.

cookies: instanceOf(Cookies).isRequired,
};

export default withCookies(Login);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh can't handle anonymous components. Add a name to your export.

import { logout, useNavigate } from '../utils/auth_utils';
import { Cookies, withCookies } from '../utils/cookie_utils';

const Logout = ({ cookies }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.

cookies: instanceOf(Cookies).isRequired,
};

export default withCookies(Logout);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh can't handle anonymous components. Add a name to your export.

* @param {Cookies} cookies The user's current cookies
* @returns The relevant path to redirect the user to depending on authentication state.
*/
const ProtectedRoute = ({ Component, redirectPath, roles, cookies }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.

cookies: instanceOf(Cookies).isRequired,
};

export default withCookies(ProtectedRoute);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh can't handle anonymous components. Add a name to your export.

@ThatMegamind ThatMegamind linked an issue Dec 20, 2023 that may be closed by this pull request
Copy link
Member

@michellelin1 michellelin1 left a comment

Choose a reason for hiding this comment

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

overall, everything functionally works! we just have a few minor comments below. and could you also move all the new components you made to a folder called Authentication? after that you're good to merge :)

src/App.jsx Outdated Show resolved Hide resolved
src/App.jsx Outdated Show resolved Hide resolved
import { logInWithEmailAndPassword, useNavigate } from '../../utils/auth_utils';
// import { logInWithEmailAndPassword , signInWithGoogle, useNavigate } from '../utils/auth_utils';

const Login = ({ cookies }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.

cookies: instanceOf(Cookies).isRequired,
};

export default withCookies(Login);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh can't handle anonymous components. Add a name to your export.

import { logout, useNavigate } from '../../utils/auth_utils';
import { Cookies, withCookies } from '../../utils/cookie_utils';

const Logout = ({ cookies }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh only works when a file only exports components. Move your component(s) to a separate file.

cookies: instanceOf(Cookies).isRequired,
};

export default withCookies(Logout);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <react-refresh/only-export-components> reported by reviewdog 🐶
Fast refresh can't handle anonymous components. Add a name to your export.

Copy link
Member

@michellelin1 michellelin1 left a comment

Choose a reason for hiding this comment

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

lgtm :)

@michellelin1 michellelin1 merged commit edf2832 into dev Dec 30, 2023
2 of 3 checks passed
@michellelin1 michellelin1 deleted the 3-implement-auth branch December 30, 2023 01:04
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.

Implement Auth
4 participants