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

Auth #18

Merged
merged 26 commits into from
May 29, 2021
Merged

Auth #18

merged 26 commits into from
May 29, 2021

Conversation

Aksh-Bansal-dev
Copy link
Member

@Aksh-Bansal-dev Aksh-Bansal-dev commented May 19, 2021

Issue: #17

@MananJethwani MananJethwani self-requested a review May 19, 2021 13:31
@Aksh-Bansal-dev Aksh-Bansal-dev linked an issue May 20, 2021 that may be closed by this pull request
JWT_REFRESH_SECRET=
JWT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
Copy link
Member

Choose a reason for hiding this comment

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

@Aksh-Bansal-dev add a URL to the page where users need to register for google client id and secret.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it will be better to add a URL to the official docs.

Copy link
Member

Choose a reason for hiding this comment

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

@Aksh-Bansal-dev no URL added here.

@@ -36,6 +40,7 @@ mongoose.connect(
// ROUTES
Copy link
Member

Choose a reason for hiding this comment

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

@Aksh-Bansal-dev I want to propose one thing......we should create tables(collection) in the database if a developer/user is setting up the database for the first time, just check and create empty collections directly.
or am I forgetting something and it automatically creates one when it is referenced?

Copy link
Member Author

Choose a reason for hiding this comment

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

We just have to create a database in MongoDB, and the rest is handled by the mongoose. We don't need to create collections manually.

React.useEffect(() => {
updateAccessToken(setLoading);
});
// if (loading) {
Copy link
Member

Choose a reason for hiding this comment

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

should remove the comments or explain why they are present there.

Copy link
Member Author

@Aksh-Bansal-dev Aksh-Bansal-dev May 22, 2021

Choose a reason for hiding this comment

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

Yeah, I forgot to remove unnecessary comments.

@MananJethwani MananJethwani self-requested a review May 25, 2021 08:54
Copy link
Member

@MananJethwani MananJethwani left a comment

Choose a reason for hiding this comment

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

just remove these comments and squash so that I can merge this PR thx

@@ -0,0 +1 @@
_
Copy link
Member

Choose a reason for hiding this comment

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

is there actually a file named _ ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it's for husky


const RegistrationForm: React.FC = () => {
const classes = useStyles();
// const [login, setLogin] = useState(true);
Copy link
Member

Choose a reason for hiding this comment

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

@Aksh-Bansal-dev more comments

<Typography className={classes.or} align="center">
OR
</Typography>
{/* {login ? <Login setLogin={setLogin} /> : <Signup setLogin={setLogin} />} */}
Copy link
Member

Choose a reason for hiding this comment

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

same here

@@ -1,7 +1,7 @@
import React from "react";
import NavBar from "../../components/Navs/Navbar";
import { createStyles, makeStyles } from "@material-ui/core/styles";
import { Container } from "@material-ui/core";
// import { Container } from "@material-ui/core";
Copy link
Member

Choose a reason for hiding this comment

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

remove these comment lines

@@ -1,10 +1,3 @@
.fullpage {
/* display: grid;
Copy link
Member

Choose a reason for hiding this comment

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

same here

clubs?: string[];
authority: "member" | "admin";
clubs?: clubObj[];
// authority: "member" | "admin";
Copy link
Member

Choose a reason for hiding this comment

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

same here

},
},
],
// authority: {
Copy link
Member

Choose a reason for hiding this comment

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

same here

passport.authenticate("google", {
scope: ["profile", "email"],
session: false,
// scope: ["https://www.googleapis.com/auth/plus.login"],
Copy link
Member

Choose a reason for hiding this comment

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

here as well

@@ -4,44 +4,39 @@ import { getAccessToken, sendRefreshToken } from "../utils/tokenstuff";
import { verify } from "jsonwebtoken";
const Router = express.Router();

Router.post("/refresh_token", async (req, res) => {
// console.log(req);
Copy link
Member

Choose a reason for hiding this comment

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

here

@@ -24,6 +24,7 @@ export const sendRefreshToken = (res: Response, user?: User): void => {
),
{
httpOnly: true,
// path: "/",
Copy link
Member

Choose a reason for hiding this comment

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

here

@MananJethwani MananJethwani merged commit dd40fb3 into BitByte-TPC:main May 29, 2021
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.

grid system for project page
2 participants