-
Notifications
You must be signed in to change notification settings - Fork 7
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
login container for API integration #153
base: master
Are you sure you want to change the base?
login container for API integration #153
Conversation
9072159
to
14f8114
Compare
export function* userLogin(action) { | ||
try { | ||
const response = yield call(PostJson, { | ||
path: "/oauth/google", |
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.
@onkar-josh Where are maintaining the Google app credentials required for Google OAuth? i.e client IDs, secret keys?
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.
@mayuriardad we will maintain those credentials in component where google button will be located and pass them as a environment variables.
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.
@onkar-josh Similar to how u have used ENV variables on node side, do not use ENV variables directly in code. Instead, assign all ENV variables to constants (we already have a constants file) and use those constants in ur code.
|
||
if (loginAuthorization.error.message === "unauthorized user") { | ||
return <UnauthorisedErrorComponent />; | ||
} else if (loginAuthorization.error.error === "popup_closed_by_user") { |
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 different keys? sometimes error.error and sometimes error.message?
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.
error.error is the error send by google and error.message is the error which will come from api
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.
I checked the wiki doc: https://github.com/joshsoftware/peerly/wiki/API-documentation#error-response-1. Couldn't find any reference for error.error
.
@onkar-josh can u please help me understand from where did u get this error structure?
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.
actually this error is not part of API. this error occurs when we close pop-up window of google.
99de49d
to
47210fe
Compare
add styling for login form component #149