app/controllers/setup/two.js
// update to set the blog title before redirecting
update to set the blog title before redirecting
update to set the blog title before redirecting
_oauthSetup() {
        let blogTitle = this.get('blogTitle');
        let config = this.get('config');
        this.get('hasValidated').addObjects(['blogTitle', 'session']);
        return this.validate().then(() => {
            return this.store.queryRecord('setting', {type: 'blog,theme,private'})
                .then((settings) => {
                    settings.set('title', blogTitle);
                    return settings.save()
                        .then((settings) => {
                            config.set('blogTitle', settings.get('title'));
                            this.set('blogCreated', true);
                            return this.afterAuthentication(settings);
                        })
                        .catch((error) => {
                            this._handleSaveError(error);
                        });
                })
                .finally(() => {
                    this.toggleProperty('submitting');
                    this.set('session.skipAuthSuccessHandler', undefined);
                });
        });
    }
_oauthSetup ( ) { let blogTitle = this . get ( 'blogTitle' ) ; let config = this . get ( 'config' ) ; this . get ( 'hasValidated' ) . addObjects ( [ 'blogTitle' , 'session' ] ) ; return this . validate ( ) . then ( ( ) => { return this . store . queryRecord ( 'setting' , { type : 'blog,theme,private' } ) . then ( ( settings ) => { settings . set ( 'title' , blogTitle ) ; return settings . save ( ) . then ( ( settings ) => { config . set ( 'blogTitle' , settings . get ( 'title' ) ) ; this . set ( 'blogCreated' , true ) ; return this . afterAuthentication ( settings ) ; } ) . catch ( ( error ) => { this . _handleSaveError ( error ) ; } ) ; } ) . finally ( ( ) => { this . toggleProperty ( 'submitting' ) ; this . set ( 'session.skipAuthSuccessHandler' , undefined ) ; } ) ; } ) ; }
update to set the blog title before redirecting
update to set the blog title before redirecting
// update the config so that the blog title shown in // the nav bar is also updated // this.blogCreated is used by step 3 to check if step 2 // has been completed