Skip to content

Commit

Permalink
fix(signup): Auto-logging of user now kicks in correctly after signup
Browse files Browse the repository at this point in the history
Store the generated API key in local storage signup
  • Loading branch information
MathieuNls committed Nov 30, 2016
1 parent ecfed55 commit 94076a4
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/pages/signup/signup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {NavController, NavParams, Loading, LoadingController} from 'ionic-angular';

import { Storage } from '@ionic/storage';
import { Component } from '@angular/core';

import {DashboardPage} from '../dashboard/dashboard';
Expand Down Expand Up @@ -27,6 +27,7 @@ export class SignupPage extends SignupComponent{
private nav: NavController,
private navParams: NavParams,
private loadingController: LoadingController,
private storage: Storage,
//injection for SignupComponent
translate: TranslateService,
twapi: TwAPIService,
Expand All @@ -37,11 +38,16 @@ export class SignupPage extends SignupComponent{

GAService.screenview("SIGNUP");

this.userLogged.subscribe(
user => this.nav.setRoot(DashboardPage, {
user:user
})
);
this.userLogged.subscribe(user => {
this.nav.setRoot(DashboardPage, {
user:user
});
GAService.userName = user.name + " " + user.lastname;
GAService.userEmail = user.email;
console.log("setting tw-api to", user.key);
this.storage.set('tw-api', user.key);
});


this.signupAttempt.subscribe(
attempt => {
Expand Down

0 comments on commit 94076a4

Please sign in to comment.