Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Fixes #4974 - Remove wantsauth dependency for setting FxA cookie #4998

Merged
merged 1 commit into from
Oct 8, 2018

Conversation

punamdahiya
Copy link
Contributor

No description provided.

@@ -36,9 +36,8 @@ exports.HeadTemplate = class HeadTemplate extends React.Component {
for (const locale of this.props.userLocales) {
localeScripts.push(<script key={`l10n-${locale}`} src={this.props.staticLink(`/static/locales/${locale}.js`)} />);
}
const wantsAuth = !this.props.authenticated;
Copy link
Contributor Author

@punamdahiya punamdahiya Oct 4, 2018

Choose a reason for hiding this comment

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

@chenba Including you to review updated wantsAuth include criteria. With this change we will be loading wantsAuth on server only when deviceId doesn't exist

Copy link
Collaborator

Choose a reason for hiding this comment

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

We also don't want wantsAuth when the user is already authenticated through FxA.

@punamdahiya
Copy link
Contributor Author

Rest of the changes in PR are
a) Updating login and confirm login route handlers to use async -await
b) create accountId cookie on successful firefox account authentication

I am keeping isOwner changes separate from this PR which need a new attribute added to shot and believe should be a separate PR.

@@ -605,6 +611,7 @@ app.post("/api/login", function(req, res) {
return sendParams.accountId = accountId;
}).then((accountId) => {
if (vars.ownershipCheck) {

Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels unnecessary. 😃

});

app.get("/api/fxa-oauth/confirm-login", function(req, res, next) {
app.get("/api/fxa-oauth/confirm-login", async function(req, res, next) {
if (!req.deviceId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't this if stop what we're trying to do right away?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, maybe I'm confusing this particular PR with the overall goal of having FxA work without device id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this check will change to include accountId with PR that allows shots access and authentications on non-Firefox browser

Copy link
Collaborator

@chenba chenba left a comment

Choose a reason for hiding this comment

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

Cookie setting code looks ok. But we are not using that cookie value to prevent the loading of wantsAuth. Is that being done in another issue?

@punamdahiya
Copy link
Contributor Author

@chenba keeping scope of this PR to remove wantsauth dependency in existing screenshots flow. We can update it to check for updated isOwner definition (#4989) that includes accountId .

@ianb ianb self-assigned this Oct 8, 2018
@ianb ianb merged commit 16f6c5f into mozilla-services:master Oct 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants