diff --git a/src/app/commons/store/signin-init/signin-init.effect.ts b/src/app/commons/store/signin-init/signin-init.effect.ts index 4f45e82..1dd8bef 100644 --- a/src/app/commons/store/signin-init/signin-init.effect.ts +++ b/src/app/commons/store/signin-init/signin-init.effect.ts @@ -39,8 +39,8 @@ export class Effects { .ofType(ActionType.SigninSuccess) .map((action: SigninSuccess) => action.payload) .do( - (result: Map) => { - const authToken = result['authToken']; + (result) => { + const authToken = result.authToken; // console.log(`authToken: ${authToken}`); const expires = new Date(); diff --git a/src/packages/core/websocket/RxWebsocketSubject.ts b/src/packages/core/websocket/RxWebsocketSubject.ts index e0d1e39..85b6413 100644 --- a/src/packages/core/websocket/RxWebsocketSubject.ts +++ b/src/packages/core/websocket/RxWebsocketSubject.ts @@ -69,6 +69,7 @@ export class RxWebsocketSubject extends Subject { } public connect(): void { + console.log('RxWebsocketSubject.connect'); const wsSubjectConfig = Object.assign({}, this._wsSubjectConfig); if (undefined !== this._queryString) { wsSubjectConfig.url = wsSubjectConfig.url + '?' + this._queryString; @@ -98,6 +99,7 @@ export class RxWebsocketSubject extends Subject { }); this._reconnectionObservable.subscribe( () => { + console.log('RxWebsocketSubject._reconnectionObservable.subscribe'); this.connect(); }, null, diff --git a/src/packages/member/store/auth/auth.action.ts b/src/packages/member/store/auth/auth.action.ts index b079b9a..b9d2e69 100644 --- a/src/packages/member/store/auth/auth.action.ts +++ b/src/packages/member/store/auth/auth.action.ts @@ -24,7 +24,7 @@ export class Signin implements Action { export class SigninSuccess implements Action { readonly type = ActionType.SigninSuccess; - constructor(public payload: any) {} + constructor(public payload: {authToken: string, domainMember: DomainMember}) {} } export class SigninFailure implements Action { diff --git a/src/packages/member/store/auth/auth.effect.ts b/src/packages/member/store/auth/auth.effect.ts index 9989d14..cfee9ed 100644 --- a/src/packages/member/store/auth/auth.effect.ts +++ b/src/packages/member/store/auth/auth.effect.ts @@ -48,7 +48,9 @@ export class Effects { return this.memberService.signin(payload.email, payload.password); }) .map((result: any) => { - return new SigninSuccess(result); + const authToken = result['authToken']; + const domainMember = JSON.parse(result['domainMember']); + return new SigninSuccess({authToken: authToken, domainMember: domainMember}); }) .catch((error: RESTError) => { return of(new SigninFailure(error)); diff --git a/src/packages/member/store/auth/auth.reducer.ts b/src/packages/member/store/auth/auth.reducer.ts index e687516..e551cde 100644 --- a/src/packages/member/store/auth/auth.reducer.ts +++ b/src/packages/member/store/auth/auth.reducer.ts @@ -23,7 +23,7 @@ export function reducer(state = initialState, action: Actions): State { } case ActionType.SigninSuccess: { - const domainMember = action.payload['domainMember']; + const domainMember = action.payload.domainMember; return { ...state, signined: true,