diff --git a/package-lock.json b/package-lock.json index 5bbe8a9..3126eb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2373,13 +2373,13 @@ "dev": true }, "@ucap/ng-store-authentication": { - "version": "file:pack/ucap-ng-store-authentication-0.0.4.tgz", - "integrity": "sha512-auUqI5uS1VblhrcPSaHragi6mZ2E6KCJE+SjW05QSe+pNg2afmuCheQNC8bTGkaU0iDbLjgEwmPuhBfLczihRg==", - "dev": true + "version": "file:pack/ucap-ng-store-authentication-0.0.5.tgz", + "integrity": "sha512-ee4f9YqzCpmBu5YG9wnQXVtplkQwnG6IJaPHhwt8tXayW90PVq1Yxtn3SOOxNp/xCubTuSfJPo/kwcOF67bKug==" }, "@ucap/ng-store-chat": { "version": "file:pack/ucap-ng-store-chat-0.0.4.tgz", - "integrity": "sha512-rSZirwFUMv9zXllqBWpdSUbUuRz9j1O8BVIfselp9sZHdKl7Xcx9irqNnHHkF2bJpxeWzugGrgG02tdt/xrIuQ==" + "integrity": "sha512-rSZirwFUMv9zXllqBWpdSUbUuRz9j1O8BVIfselp9sZHdKl7Xcx9irqNnHHkF2bJpxeWzugGrgG02tdt/xrIuQ==", + "dev": true }, "@ucap/ng-store-group": { "version": "file:pack/ucap-ng-store-group-0.0.5.tgz", diff --git a/package.json b/package.json index 2ee3d9c..a2f8b2e 100644 --- a/package.json +++ b/package.json @@ -165,7 +165,7 @@ "@ucap/ng-protocol-status": "file:pack/ucap-ng-protocol-status-0.0.1.tgz", "@ucap/ng-protocol-sync": "file:pack/ucap-ng-protocol-sync-0.0.1.tgz", "@ucap/ng-protocol-umg": "file:pack/ucap-ng-protocol-umg-0.0.1.tgz", - "@ucap/ng-store-authentication": "file:pack/ucap-ng-store-authentication-0.0.4.tgz", + "@ucap/ng-store-authentication": "file:pack/ucap-ng-store-authentication-0.0.5.tgz", "@ucap/ng-store-chat": "file:pack/ucap-ng-store-chat-0.0.4.tgz", "@ucap/ng-store-group": "file:pack/ucap-ng-store-group-0.0.5.tgz", "@ucap/ng-store-organization": "file:pack/ucap-ng-store-organization-0.0.3.tgz", diff --git a/projects/store-authentication/package.json b/projects/store-authentication/package.json index 3af003c..77e6aff 100644 --- a/projects/store-authentication/package.json +++ b/projects/store-authentication/package.json @@ -1,6 +1,6 @@ { "name": "@ucap/ng-store-authentication", - "version": "0.0.4", + "version": "0.0.5", "publishConfig": { "registry": "http://10.81.13.221:8081/nexus/repository/npm-ucap/" }, diff --git a/projects/store-authentication/src/lib/store/authorization/effects.ts b/projects/store-authentication/src/lib/store/authorization/effects.ts index e4de838..5229040 100644 --- a/projects/store-authentication/src/lib/store/authorization/effects.ts +++ b/projects/store-authentication/src/lib/store/authorization/effects.ts @@ -5,11 +5,14 @@ import { Injectable } from '@angular/core'; import { Actions, createEffect, ofType } from '@ngrx/effects'; +import { RegViewResponse } from '@ucap/protocol-option'; import { AuthResponse } from '@ucap/protocol-query'; import { QueryProtocolService } from '@ucap/ng-protocol-query'; import { OptionProtocolService } from '@ucap/ng-protocol-option'; +import * as LoginActions from '../login/actions'; + import { auth, authSuccess, @@ -18,10 +21,18 @@ import { regViewSuccess, regViewFailure } from './actions'; -import { RegViewResponse } from '@ucap/protocol-option'; @Injectable() export class Effects { + postLoginSuccessForAuth$ = createEffect(() => { + return this.actions$.pipe( + ofType(LoginActions.loginSuccess), + map(action => + auth({ req: { deviceType: action.loginSession.deviceType } }) + ) + ); + }); + auth$ = createEffect(() => this.actions$.pipe( ofType(auth), @@ -39,6 +50,13 @@ export class Effects { ) ); + postLoginSuccessForRegView$ = createEffect(() => { + return this.actions$.pipe( + ofType(LoginActions.loginSuccess), + map(action => regView({ req: {} })) + ); + }); + regView$ = createEffect(() => this.actions$.pipe( ofType(regView),