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

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

Merged
merged 11 commits into from
Mar 8, 2019

Conversation

williamchong
Copy link
Member

No description provided.

@@ -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`;
Copy link
Contributor

Choose a reason for hiding this comment

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

authCode unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

How about this?

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

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 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}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

state is not needed in access token request

👌 Don't send state when getting access token with authCode
@williamchong williamchong merged commit 9179ed6 into master Mar 8, 2019
williamchong pushed a commit that referenced this pull request Dec 6, 2023
* 💄 Display gift info on claim page

* 🎨 Wrap download section into canViewContentDirectly
williamchong pushed a commit that referenced this pull request Dec 7, 2023
williamchong pushed a commit that referenced this pull request Dec 7, 2023
williamchong added a commit that referenced this pull request Dec 13, 2023
* 💄 Add gift dialog in book

* 💄 Add gift success page

* 💄 Add gift message in claim page

* 💄 Hide gift button for free book

* 💄 Update GiftDialog UI

* 💄 Display gift info on claim page (#6)

* 💬 Update gift related text

* 💬 Update book gift dialog placeholder

Co-authored-by: Wei-Jun Hung <33746295+WeiJun0827@users.noreply.github.com>

* 💩 Block LIKE book payment for gift

---------

Co-authored-by: AuroraHuang22 <aurora90376@gmail.com>
Co-authored-by: AuroraHuang22 <75730405+AuroraHuang22@users.noreply.github.com>
Co-authored-by: Wei-Jun Hung <33746295+WeiJun0827@users.noreply.github.com>
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.

2 participants