-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
🏗 Add firebase cloud function
🎨 Clean up oauth code and move most config to server
src/util/api/index.js
Outdated
@@ -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`; |
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.
authCode
unused?
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.
because axios is outside, so cannot put it into payload here
maybe should put axios back inside here?
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.
How about this?
export const getLoginStatus = () => `/api/users/self`;
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 think corrected in later commits in this PR
src/server/api/util/api.js
Outdated
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}`; |
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.
state
is not needed in access token request
👌 Don't send state when getting access token with authCode
* 💄 Display gift info on claim page * 🎨 Wrap download section into canViewContentDirectly
* 💄 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>
No description provided.