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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃敀 Support state in oauth login, add configs, and fix some minor bugs #6

Merged
merged 11 commits into from Mar 8, 2019

Conversation

Projects
None yet
2 participants
@williamchong007
Copy link
Member

commented Mar 7, 2019

No description provided.

@williamchong007 williamchong007 requested review from nnkken, mckingho and nwingt Mar 7, 2019

@@ -16,3 +16,4 @@ export const getFetchUserArticlesAPI = user => `/api/reader/user/${user}`;
export const getOAuthURL = () =>
`${LIKE_CO_URL_BASE}/in/oauth?client_id=${CLIENT_ID}&redirect_uri=${OAUTH_REDIRECT_URI}&scope=read%3Alike.info`;
export const getOAuthCallbackAPI = authCode => `/api/users/login`;
export const getLoginStatus = authCode => `/api/users/self`;

This comment has been minimized.

Copy link
@nnkken

nnkken Mar 8, 2019

Member

authCode unused?

This comment has been minimized.

Copy link
@williamchong007

williamchong007 Mar 8, 2019

Author Member

because axios is outside, so cannot put it into payload here
maybe should put axios back inside here?

This comment has been minimized.

Copy link
@nnkken

nnkken Mar 8, 2019

Member

How about this?

export const getLoginStatus = () => `/api/users/self`;

This comment has been minimized.

Copy link
@williamchong007

williamchong007 Mar 8, 2019

Author Member

i think corrected in later commits in this PR

const getOAuthURL = state =>
`${LIKE_CO_URL_BASE}/in/oauth?client_id=${LIKE_CO_CLIENT_ID}&redirect_uri=${OAUTH_REDIRECT_URI}&scope=read%3Alike.info&state=${state}`;
const getOAuthCallbackAPI = (authCode, state) =>
`${LIKE_CO_URL_BASE}/api/oauth/access_token?client_id=${LIKE_CO_CLIENT_ID}&client_secret=${LIKE_CO_CLIENT_SECRET}&grant_type=authorization_code&redirect_uri=${OAUTH_REDIRECT_URI}&auth_code=${authCode}&state=${state}`;

This comment has been minimized.

Copy link
@nnkken

nnkken Mar 8, 2019

Member

state is not needed in access token request

馃悰 Fix wrong cookie secret setting
馃憣 Don't send state when getting access token with authCode
@nnkken

nnkken approved these changes Mar 8, 2019

@williamchong007 williamchong007 merged commit 9179ed6 into master Mar 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.