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

Mwalsh/social signup #95

Merged
merged 37 commits into from
Apr 17, 2017
Merged

Mwalsh/social signup #95

merged 37 commits into from
Apr 17, 2017

Conversation

walsh9
Copy link
Contributor

@walsh9 walsh9 commented Mar 20, 2017

Expect creation of third-party users to happen on the server side.
Move display of account-based flash messages to the account-wrapper template
Tests for Facebook signup

https://jira.wnyc.org/browse/WE-6588
https://jira.wnyc.org/browse/WE-6869

@walsh9
Copy link
Contributor Author

walsh9 commented Apr 6, 2017

Should be merged at same time as:
nypublicradio/nypr-account-settings#8

if (response && response.ok) {
resolve(authData);
// if we get a 401 Unauthorized, create a user
} else if (response && response.status === 401 && userAttrs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking: this is the part that the auth service is going to handle now, right? Perhaps this will remove the need to set this cross-concern 'isNewSocialUser' flag?

// this access token has since been revoked
this.get('session').invalidate();
});
} else {
return RSVP.resolve();
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this for?

import fetch from 'fetch';
import getOwner from 'ember-owner/get';

export default SessionService.extend({
store: service(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't see this used anywhere


export default FacebookConnectProvider.extend({
open() {
return new RSVP.Promise((resolve, reject) => {
this._super().then((data) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for ...arguments?

@noslouch
Copy link
Contributor

noslouch commented Apr 8, 2017

Love those test helpers! Definitely the right move putting them in their own spot. And that registerMovkOnInstance is seriously paying dividends. Great work!

Copy link
Contributor

@noslouch noslouch left a comment

Choose a reason for hiding this comment

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

a few questions, but overall great!

})
.catch(reject);
})
.catch(reject);
Copy link
Contributor

Choose a reason for hiding this comment

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

what if you only rejected in this outermost catch? I think errors will bubble.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I'm just going to rewrite this so it doesn't use nested promises.

@@ -9,7 +9,10 @@ export default Service.extend({
if (this.get('session.isAuthenticated')) {
let user = this.get('store').queryRecord('user', {me: true});
this.set('user', user);
user.catch(() => {
return user.then((user) => {
this.set('user', user);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this all about? you're setting the user as the value of the promise and then overriding that with the resolve value? won't ember do the fulfillment behind the scenes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think this was leftover from a weird issue when we were doing that weird double authentication thing and can be removed now. I'll clean it up and make sure it still works.

package.json Outdated
"nypr-ads": "nypublicradio/nypr-ads",
"nypr-player": "nypublicradio/nypr-player",
"nypr-ui": "nypublicradio/nypr-ui",
"nypr-ads": "nypublicradio/nypr-ads",
"nypr-ui": "nypublicradio/nypr-ui",
Copy link
Contributor

Choose a reason for hiding this comment

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

ui and ads wound up in here twice

package.json Outdated
"nypr-ads": "nypublicradio/nypr-ads",
"nypr-player": "nypublicradio/nypr-player",
"nypr-ui": "nypublicradio/nypr-ui",
"nypr-account-settings": "nypublicradio/nypr-account-settings#d4a20e76df91c1150e581a16bcf47420b38d98d8",
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this hash? should it be removed before merging?

Copy link
Contributor Author

@walsh9 walsh9 Apr 17, 2017

Choose a reason for hiding this comment

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

after merging nypublicradio/nypr-account-settings#8 i should be able to remove the hash and this and nypublicradio/wqxr-web-client#73 can be merged

Copy link
Contributor

Choose a reason for hiding this comment

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

nypublicradio/nypr-account-settings#8 looks like it's good to merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah was just waiting for this to be ready so I can merge them around the same time. I can start now.

@walsh9 walsh9 merged commit b8ffc2e into master Apr 17, 2017
@noslouch noslouch deleted the mwalsh/social-signup branch April 17, 2017 21:56
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