Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/bitproject/bit-next/dyw2tuk01 |
| db.init_app(app) | ||
| migrate.init_app(app, db) | ||
| jwt.init_app(app) | ||
| app.config['GITHUB_CLIENT_ID'] = '98574e099fa640413899' |
There was a problem hiding this comment.
We should put the client secret and client id in the .env file
backend/conduit/user/views.py
Outdated
| #refactor and hide these | ||
|
|
||
| #NOTE: use try catch block later | ||
| payload = { 'client_id': "98574e099fa640413899", |
There was a problem hiding this comment.
Replace hard coded secrets with environment variables.
backend/conduit/user/views.py
Outdated
| user.token = create_access_token(identity=user, fresh=True) | ||
| return user | ||
|
|
||
| # Flask Migrate |
There was a problem hiding this comment.
Erase any code/comments that you no longer need
components/profile/LoginForm.tsx
Outdated
| const code = new URLSearchParams(window.location.search).get("code"); | ||
| if (code){ | ||
| logging_in = (<p>Redirecting to home page...</p>); | ||
| React.useEffect(() => { |
There was a problem hiding this comment.
Import the useState function from react instead of React.useState. Makes the code more easy to read.
components/profile/LoginForm.tsx
Outdated
| </button> | ||
| </fieldset> | ||
| </form> | ||
| <a href="https://github.com/login/oauth/authorize?client_id=98574e099fa640413899&scope=user+repo" |
There was a problem hiding this comment.
Again use environment variables instead of hard coded values.
Implemented oAuth flow that connects with backend. Most github operations are performed in the backend to avoid third party interference. Have to refactor: