-
Notifications
You must be signed in to change notification settings - Fork 942
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
Add Facebook login #1366
Add Facebook login #1366
Conversation
75d08d9
to
e5d7fc3
Compare
a8de9ec
to
b4eb179
Compare
85bec53
to
5e1d608
Compare
b4eb179
to
3d6099a
Compare
server/api/auth/loginWithIdp.js
Outdated
res | ||
.cookie( | ||
'st-autherror', | ||
{ | ||
status: err.status, | ||
code: err.code, | ||
message: err.message, | ||
}, | ||
{ | ||
maxAge: 15 * 60 * 1000, // 15 minutes | ||
} | ||
) |
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.
There are two new cookies st-autherror
and st-auhtinfo
in this flow and @Gnito mentioned that it would be good to document the cookies we use in some place. I'm not sure what would be the best place to do this? E.g. add article to Flex docs or something else
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'd vote Flex Docs.
tab, | ||
sendVerificationEmailInProgress, | ||
sendVerificationEmailError, | ||
onResendVerificationEmail, | ||
onManageDisableScrolling, | ||
showSocialLoginsForTests, |
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.
The snapshot test for AuthenticationPage caused some issues because in the local environment facebook app id was in environment variables and in CI it was not. Because of this, the social login button was added to snapshot when running tests locally but in CI the page was expected to be rendered without the social login button.
Adding extra prop feels really hacky but I'm not sure in what another way we could ensure that the page is rendered similarly locally and in CI. Also with the prop, it was possible to test both options.
Do you have any better ideas on how to handle the snapshot test (or do we even need to keep it)?
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.
Yeah, I agree, this feels a bit hacky.
Jest should automatically define NODE_ENV to be 'test'.
So, try adding the Facebook app id to .env.test (maybe as empty)
) : null; | ||
|
||
const formContent = isConfirm ? ( | ||
<div className={css.content}> |
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.
One thing to consider in this kind of ternary-chain is that should one or more of these be subcomponent (inside this directory) to improve readability.
(And I'm not saying that this is necessarily hard to read, but in Github, it's a bit confusing due to partially visible content.)
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 added some comments.
I'm not sure I'm completely aware of all the aspects, but I still think we should parameterize all the possible return paths.
9643162
to
91e6dfd
Compare
… other small UI fixes
6f7d350
to
8cd84e0
Compare
Adds Facebook login to FTW
This is how the authentication flow works in general:
(these graphs are also in Whimsical Socia logins & SSO board https://whimsical.com/GcZr7nhZwex4WfYgAuiHFG)
If a new user needs to be created there is a new
ConfirmSignupForm
onConfirmPage
to confirm the data fetched from e.g. Facebook:This PR can be merged after #1365 is merged to the base branch #1364