-
Notifications
You must be signed in to change notification settings - Fork 1
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
#164109890 add redirect to social controller #45
#164109890 add redirect to social controller #45
Conversation
src/controllers/SocialsController.js
Outdated
import models from '../db/models'; | ||
import TokenAuthenticate from '../helpers/TokenAuthenticate'; | ||
import Response from '../helpers/response'; | ||
|
||
dotenv.config(); | ||
|
||
const { FRONTEND_BASE_PATH } = process.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
src/controllers/SocialsController.js
Outdated
@@ -1,9 +1,14 @@ | |||
/* eslint-disable no-underscore-dangle */ | |||
/* eslint-disable camelcase */ | |||
import dotenv from 'dotenv' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
if (newUser) { | ||
response = new Response( | ||
'Ok', | ||
201, | ||
'User logged in successfully', | ||
{ token } | ||
); | ||
return res.status(response.code).json(response); | ||
return res.redirect(`${FRONTEND_BASE_PATH}/auth?token=${token}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you redirecting from the server? I'll go ahead and merge this in the meantime though
I also don't know why you removed some test @Proception. Please find time to fix the test coverage |
What does this PR do?
This adds a redirect to the social authentication process to the frontend
Description of Task to be completed?
How should this be manually tested?
npm run start:dev
http://localhost:9000/api/v1/auth/{provider}/callback
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#164109890
Screenshots (if appropriate)
N/A