mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-22 14:22:48 +01:00
scroll top & channel backup fix
scroll top & channel backup fix
This commit is contained in:
parent
8fdba67a5d
commit
7dfb355ead
20 changed files with 64 additions and 69 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -12,5 +12,5 @@
|
|||
<link rel="stylesheet" href="styles.90ee7bcb73e8367b2a29.css"></head>
|
||||
<body>
|
||||
<rtl-app></rtl-app>
|
||||
<script src="runtime.381542d227df565e3542.js" defer></script><script src="polyfills-es5.37b2eeccc22c1df73ce7.js" nomodule defer></script><script src="polyfills.f1c3d2a0bcdfc4e93ca8.js" defer></script><script src="main.44eca5bf638d8b08e871.js" defer></script></body>
|
||||
<script src="runtime.2e6ad7cb977005b4f6b6.js" defer></script><script src="polyfills-es5.37b2eeccc22c1df73ce7.js" nomodule defer></script><script src="polyfills.f1c3d2a0bcdfc4e93ca8.js" defer></script><script src="main.358e40c47b3010ffb98f.js" defer></script></body>
|
||||
</html>
|
||||
|
|
1
angular/main.358e40c47b3010ffb98f.js
Normal file
1
angular/main.358e40c47b3010ffb98f.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],l=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"b78c4146e439be098e08",6:"17ce0762d67b997b139c",7:"731a74a56a4c6565c2cc"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([]);
|
||||
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],l=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,l||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"b78c4146e439be098e08",6:"30c4bc397969e1e00c8a",7:"4629778ec16eba9683e4"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([]);
|
19
connect.js
19
connect.js
|
@ -405,12 +405,8 @@ connect.modifyJsonForNewUX = (confFileFullPath) => {
|
|||
newConfig.nodes.push(newNode);
|
||||
});
|
||||
}
|
||||
if(config.multiPass) {
|
||||
newConfig.multiPass = config.multiPass;
|
||||
} else if(config.multiPassHashed) {
|
||||
newConfig.multiPassHashed = config.multiPassHashed;
|
||||
}
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(newConfig));
|
||||
newConfig.multiPassHashed = config.multiPassHashed ? config.multiPassHashed : config.multiPass ? hash.update(config.multiPass).digest('hex') : '';
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(newConfig, null, 2), 'utf-8');
|
||||
}
|
||||
|
||||
connect.upgradeIniToJson = (confFileFullPath) => {
|
||||
|
@ -469,13 +465,8 @@ connect.upgradeIniToJson = (confFileFullPath) => {
|
|||
} else if (config.Authentication.lndServerUrl) {
|
||||
newConfig.nodes[0].Settings.lnServerUrl = config.Authentication.lndServerUrl;
|
||||
}
|
||||
|
||||
if(config.Authentication.rtlPass) {
|
||||
newConfig.multiPass = config.Authentication.rtlPass;
|
||||
} else if(config.Authentication.rtlPassHashed) {
|
||||
newConfig.multiPassHashed = config.Authentication.rtlPassHashed;
|
||||
}
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(newConfig));
|
||||
newConfig.multiPassHashed = config.Authentication.rtlPassHashed ? config.Authentication.rtlPassHashed : config.Authentication.rtlPass ? hash.update(config.Authentication.rtlPass).digest('hex') : '';
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(newConfig, null, 2), 'utf-8');
|
||||
}
|
||||
|
||||
connect.upgradeConfig = (confFileFullPath) => {
|
||||
|
@ -490,7 +481,7 @@ connect.upgradeConfig = (confFileFullPath) => {
|
|||
connect.upgradeIniToJson(confFileFullPath);
|
||||
} else if (!singleNodeExists && !multiNodeExists) {
|
||||
if (!fs.existsSync(confFileFullPath)) {
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(connect.setDefaultConfig()));
|
||||
fs.writeFileSync(confFileFullPath, JSON.stringify(connect.setDefaultConfig(), null, 2), 'utf-8');
|
||||
}
|
||||
}
|
||||
} catch(err) {
|
||||
|
|
|
@ -42,7 +42,7 @@ exports.getRTLConfig = (req, res, next) => {
|
|||
} else {
|
||||
authentication.configPath = '';
|
||||
}
|
||||
if(node.Settings.bitcoindConfigPath) {
|
||||
if(node.Settings.bitcoindConfigPath) {
|
||||
authentication.bitcoindConfigPath = node.Settings.bitcoindConfigPath;
|
||||
}
|
||||
node.Settings.channelBackupPath = (node.Settings.channelBackupPath) ? node.Settings.channelBackupPath : common.nodes[i].channel_backup_path;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, OnInit, AfterViewInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil, filter } from 'rxjs/operators';
|
||||
|
@ -12,7 +12,7 @@ import * as sha256 from 'sha256';
|
|||
import { LoggerService } from './shared/services/logger.service';
|
||||
import { CommonService } from './shared/services/common.service';
|
||||
import { SessionService } from './shared/services/session.service';
|
||||
import { AlertTypeEnum, ScreenSizeEnum, NODE_SETTINGS } from './shared/services/consts-enums-functions';
|
||||
import { AlertTypeEnum, ScreenSizeEnum } from './shared/services/consts-enums-functions';
|
||||
import { RTLConfiguration, Settings, ConfigSettingsNode, GetInfoRoot } from './shared/models/RTLconfig';
|
||||
|
||||
import * as RTLActions from './store/rtl.actions';
|
||||
|
@ -41,6 +41,10 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
private userIdle: UserIdleService, private router: Router, private sessionService: SessionService, private breakpointObserver: BreakpointObserver) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.router.events.subscribe((evt) => {
|
||||
if (!(evt instanceof NavigationEnd)) { return; }
|
||||
document.getElementsByTagName('mat-sidenav-content')[0].scrollTo(0, 0);
|
||||
});
|
||||
this.breakpointObserver.observe([Breakpoints.XSmall, Breakpoints.TabletPortrait, Breakpoints.Small, Breakpoints.Medium])
|
||||
.pipe(takeUntil(this.unSubs[5]))
|
||||
.subscribe((matches) => {
|
||||
|
@ -84,7 +88,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
if (action.type === RTLActions.SET_RTL_CONFIG) {
|
||||
if (!this.sessionService.getItem('token')) {
|
||||
if (+action.payload.sso.rtlSSO) {
|
||||
this.store.dispatch(new RTLActions.Signin(sha256(this.accessKey)));
|
||||
this.store.dispatch(new RTLActions.Login(sha256(this.accessKey)));
|
||||
} else {
|
||||
this.router.navigate([this.appConfig.sso.logoutRedirectLink]);
|
||||
}
|
||||
|
@ -105,7 +109,7 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
alertTitle: 'Logging out',
|
||||
titleMessage: 'Time limit exceeded for session inactivity.'
|
||||
}}));
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
this.userIdle.resetTimer();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ import { ModuleWithProviders } from '@angular/core';
|
|||
import { SettingsComponent } from './shared/components/settings/settings.component';
|
||||
import { NotFoundComponent } from './shared/components/not-found/not-found.component';
|
||||
import { HelpComponent } from './shared/components/help/help.component';
|
||||
import { SigninComponent } from './shared/components/signin/signin.component';
|
||||
import { LoginComponent } from './shared/components/login/login.component';
|
||||
import { ErrorComponent } from './shared/components/error/error.component';
|
||||
import { AuthGuard } from './shared/services/auth.guard';
|
||||
|
||||
|
@ -13,7 +13,7 @@ export const routes: Routes = [
|
|||
{ path: 'cl', loadChildren: () => import('./clightning/cl.module').then(childModule => childModule.CLModule), canActivate: [AuthGuard] },
|
||||
{ path: 'settings', component: SettingsComponent, canActivate: [AuthGuard] },
|
||||
{ path: 'help', component: HelpComponent },
|
||||
{ path: 'login', component: SigninComponent },
|
||||
{ path: 'login', component: LoginComponent },
|
||||
{ path: 'error', component: ErrorComponent },
|
||||
{ path: '**', component: NotFoundComponent }
|
||||
];
|
||||
|
|
|
@ -736,8 +736,8 @@ export class CLEffects implements OnDestroy {
|
|||
handleErrorWithoutAlert(actionName: string, err: { status: number, error: any }) {
|
||||
this.logger.error('ERROR IN: ' + actionName + '\n' + JSON.stringify(err));
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.EffectErrorCl({ action: actionName, code: err.status.toString(), message: err.error.error }));
|
||||
}
|
||||
|
@ -746,8 +746,8 @@ export class CLEffects implements OnDestroy {
|
|||
handleErrorWithAlert(alerType: string, alertTitle: string, errURL: string, err: { status: number, error: any }) {
|
||||
this.logger.error(err);
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.CloseSpinner());
|
||||
this.store.dispatch(new RTLActions.OpenAlert({
|
||||
|
|
|
@ -1115,8 +1115,8 @@ export class LNDEffects implements OnDestroy {
|
|||
handleErrorWithoutAlert(actionName: string, err: { status: number, error: any }) {
|
||||
this.logger.error('ERROR IN: ' + actionName + '\n' + JSON.stringify(err));
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.EffectErrorLnd({ action: actionName, code: err.status.toString(), message: err.error.error }));
|
||||
}
|
||||
|
@ -1125,8 +1125,8 @@ export class LNDEffects implements OnDestroy {
|
|||
handleErrorWithAlert(alertType: string, alertTitle: string, errURL: string, err: { status: number, error: any }) {
|
||||
this.logger.error(err);
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.CloseSpinner());
|
||||
this.store.dispatch(new RTLActions.OpenAlert({
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<div fxLayout="row" fxLayoutAlign="start center" class="padding-gap-x page-title-container">
|
||||
<fa-icon [icon]="faUnlockAlt" class="page-title-img mr-1"></fa-icon>
|
||||
<span class="page-title">Signin to RTL</span>
|
||||
<span class="page-title">Login to RTL</span>
|
||||
</div>
|
||||
<div fxLayout="column">
|
||||
<div class="padding-gap">
|
||||
<mat-card>
|
||||
<mat-card-content class="card-content-gap">
|
||||
<form (ngSubmit)="onSignin()" #signinForm="ngForm" fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutAlign="start" fxLayoutAlign.gt-sm="space-between">
|
||||
<form (ngSubmit)="onLogin()" #loginForm="ngForm" fxLayout="column" fxLayout.gt-sm="row wrap" fxLayoutAlign="start" fxLayoutAlign.gt-sm="space-between">
|
||||
<mat-form-field fxFlex="100" fxLayoutAlign="start">
|
||||
<input matInput placeholder="Password" type="password" id="password" name="password" [(ngModel)]="password" tabindex="1" required>
|
||||
<mat-error *ngIf="!password">Password is required.</mat-error>
|
|
@ -12,11 +12,11 @@ import * as fromRTLReducer from '../../../store/rtl.reducers';
|
|||
import * as RTLActions from '../../../store/rtl.actions';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-signin',
|
||||
templateUrl: './signin.component.html',
|
||||
styleUrls: ['./signin.component.scss']
|
||||
selector: 'rtl-login',
|
||||
templateUrl: './login.component.html',
|
||||
styleUrls: ['./login.component.scss']
|
||||
})
|
||||
export class SigninComponent implements OnInit, OnDestroy {
|
||||
export class LoginComponent implements OnInit, OnDestroy {
|
||||
public faUnlockAlt = faUnlockAlt;
|
||||
public selNode: ConfigSettingsNode;
|
||||
public password = '';
|
||||
|
@ -40,9 +40,9 @@ export class SigninComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
onSignin() {
|
||||
onLogin() {
|
||||
if(!this.password) { return true; }
|
||||
this.store.dispatch(new RTLActions.Signin(sha256(this.password)));
|
||||
this.store.dispatch(new RTLActions.Login(sha256(this.password)));
|
||||
}
|
||||
|
||||
resetData() {
|
|
@ -101,8 +101,8 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
|
|||
this.flgLoading = session.token ? true : false;
|
||||
});
|
||||
this.actions$.pipe(takeUntil(this.unSubs[2]),
|
||||
filter((action) => action.type === RTLActions.SIGNOUT))
|
||||
.subscribe((action: RTLActions.Signout) => {
|
||||
filter((action) => action.type === RTLActions.LOGOUT))
|
||||
.subscribe((action: RTLActions.Logout) => {
|
||||
this.showLogout = false;
|
||||
});
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ export class SideNavigationComponent implements OnInit, OnDestroy {
|
|||
.subscribe(confirmRes => {
|
||||
if (confirmRes) {
|
||||
this.showLogout = false;
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ export class TopMenuComponent implements OnInit, OnDestroy {
|
|||
this.actions$
|
||||
.pipe(
|
||||
takeUntil(this.unSubs[2]),
|
||||
filter((action) => action.type === RTLActions.SIGNOUT)
|
||||
filter((action) => action.type === RTLActions.LOGOUT)
|
||||
).subscribe(() => {
|
||||
this.showLogout = false;
|
||||
});
|
||||
|
@ -86,7 +86,7 @@ export class TopMenuComponent implements OnInit, OnDestroy {
|
|||
.subscribe(confirmRes => {
|
||||
if (confirmRes) {
|
||||
this.showLogout = false;
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import { ConfirmationMessageComponent } from './components/data-modal/confirmati
|
|||
import { ErrorMessageComponent } from './components/data-modal/error-message/error-message.component';
|
||||
import { SpinnerDialogComponent } from './components/data-modal/spinner-dialog/spinner-dialog.component';
|
||||
import { NotFoundComponent } from './components/not-found/not-found.component';
|
||||
import { SigninComponent } from './components/signin/signin.component';
|
||||
import { LoginComponent } from './components/login/login.component';
|
||||
import { HelpComponent } from './components/help/help.component';
|
||||
import { SideNavigationComponent } from './components/navigation/side-navigation/side-navigation.component';
|
||||
import { TopMenuComponent } from './components/navigation/top-menu/top-menu.component';
|
||||
|
@ -144,7 +144,7 @@ import { LoggerService, ConsoleLoggerService } from '../shared/services/logger.s
|
|||
NotFoundComponent,
|
||||
SideNavigationComponent,
|
||||
TopMenuComponent,
|
||||
SigninComponent,
|
||||
LoginComponent,
|
||||
HelpComponent,
|
||||
ServerConfigComponent,
|
||||
CurrencyUnitConverterComponent,
|
||||
|
@ -168,7 +168,7 @@ import { LoggerService, ConsoleLoggerService } from '../shared/services/logger.s
|
|||
NotFoundComponent,
|
||||
SideNavigationComponent,
|
||||
TopMenuComponent,
|
||||
SigninComponent,
|
||||
LoginComponent,
|
||||
HelpComponent,
|
||||
ServerConfigComponent,
|
||||
CurrencyUnitConverterComponent,
|
||||
|
|
|
@ -92,8 +92,8 @@ export const FETCH_CONFIG = 'FETCH_CONFIG';
|
|||
export const SHOW_CONFIG = 'SHOW_CONFIG';
|
||||
export const IS_AUTHORIZED = 'IS_AUTHORIZED';
|
||||
export const IS_AUTHORIZED_RES = 'IS_AUTHORIZED_RES';
|
||||
export const SIGNIN = 'SIGNIN';
|
||||
export const SIGNOUT = 'SIGNOUT';
|
||||
export const LOGIN = 'LOGIN';
|
||||
export const LOGOUT = 'LOGOUT';
|
||||
export const PEER_LOOKUP = 'PEER_LOOKUP';
|
||||
export const CHANNEL_LOOKUP = 'CHANNEL_LOOKUP';
|
||||
export const INVOICE_LOOKUP = 'INVOICE_LOOKUP';
|
||||
|
@ -593,13 +593,13 @@ export class IsAuthorizedRes implements Action {
|
|||
constructor(public payload: any) {} // payload = token/error
|
||||
}
|
||||
|
||||
export class Signin implements Action {
|
||||
readonly type = SIGNIN;
|
||||
export class Login implements Action {
|
||||
readonly type = LOGIN;
|
||||
constructor(public payload: string) {} // payload = password
|
||||
}
|
||||
|
||||
export class Signout implements Action {
|
||||
readonly type = SIGNOUT;
|
||||
export class Logout implements Action {
|
||||
readonly type = LOGOUT;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ export type RTLActions =
|
|||
GetNewAddress | SetNewAddress | SetChannelTransaction |
|
||||
GenSeed | GenSeedResponse | InitWallet | InitWalletResponse | UnlockWallet |
|
||||
FetchConfig | ShowConfig | PeerLookup | ChannelLookup | InvoiceLookup | SetLookup |
|
||||
IsAuthorized | IsAuthorizedRes | Signin | Signout |
|
||||
IsAuthorized | IsAuthorizedRes | Login | Logout |
|
||||
SetChildNodeSettingsCL | FetchInfoCL | SetInfoCL | FetchFeesCL | SetFeesCL | FetchFeeRatesCL | SetFeeRatesCL |
|
||||
FetchBalanceCL | SetBalanceCL | FetchLocalRemoteBalanceCL | SetLocalRemoteBalanceCL |
|
||||
GetNewAddressCL | SetNewAddressCL |
|
||||
|
|
|
@ -269,13 +269,13 @@ export class RTLEffects implements OnDestroy {
|
|||
);
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
authSignin = this.actions$.pipe(
|
||||
ofType(RTLActions.SIGNIN),
|
||||
authLogin = this.actions$.pipe(
|
||||
ofType(RTLActions.LOGIN),
|
||||
withLatestFrom(this.store.select('root')),
|
||||
mergeMap(([action, rootStore]: [RTLActions.Signin, fromRTLReducer.RootState]) => {
|
||||
mergeMap(([action, rootStore]: [RTLActions.Login, fromRTLReducer.RootState]) => {
|
||||
this.store.dispatch(new RTLActions.ClearEffectErrorLnd('FetchInfo'));
|
||||
this.store.dispatch(new RTLActions.ClearEffectErrorCl('FetchInfoCL'));
|
||||
this.store.dispatch(new RTLActions.ClearEffectErrorRoot('Signin'));
|
||||
this.store.dispatch(new RTLActions.ClearEffectErrorRoot('Login'));
|
||||
return this.httpClient.post(environment.AUTHENTICATE_API, {
|
||||
authenticateWith: (undefined === action.payload || action.payload == null || action.payload === '') ? AuthenticateWith.TOKEN : AuthenticateWith.PASSWORD,
|
||||
authenticationValue: (undefined === action.payload || action.payload == null || action.payload === '') ? (this.sessionService.getItem('token') ? this.sessionService.getItem('token') : '') : action.payload
|
||||
|
@ -289,9 +289,9 @@ export class RTLEffects implements OnDestroy {
|
|||
this.store.dispatch(new RTLActions.SetSelelectedNode({lnNode: rootStore.selNode, isInitialSetup: true}))
|
||||
}),
|
||||
catchError((err) => {
|
||||
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'Signin', code: err.status, message: err.error.message }));
|
||||
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: 'Login', code: err.status, message: err.error.message }));
|
||||
this.handleErrorWithAlert('ERROR', 'Authorization Failed!', environment.AUTHENTICATE_API, err.error);
|
||||
this.logger.info('Redirecting to Signin Error Page');
|
||||
this.logger.info('Redirecting to Login Error Page');
|
||||
if (+rootStore.appConfig.sso.rtlSSO) {
|
||||
this.router.navigate(['/error'], { state: { errorCode: '401', errorMessage: 'Single Sign On Failed!' }});
|
||||
} else {
|
||||
|
@ -303,8 +303,8 @@ export class RTLEffects implements OnDestroy {
|
|||
}));
|
||||
|
||||
@Effect({ dispatch: false })
|
||||
signOut = this.actions$.pipe(
|
||||
ofType(RTLActions.SIGNOUT),
|
||||
logOut = this.actions$.pipe(
|
||||
ofType(RTLActions.LOGOUT),
|
||||
withLatestFrom(this.store.select('root')),
|
||||
mergeMap(([action, store]) => {
|
||||
if (+store.appConfig.sso.rtlSSO) {
|
||||
|
@ -377,8 +377,8 @@ export class RTLEffects implements OnDestroy {
|
|||
handleErrorWithoutAlert(actionName: string, err: { status: number, error: any }) {
|
||||
this.logger.error('ERROR IN: ' + actionName + '\n' + JSON.stringify(err));
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.EffectErrorRoot({ action: actionName, code: err.status.toString(), message: err.error.error }));
|
||||
}
|
||||
|
@ -387,8 +387,8 @@ export class RTLEffects implements OnDestroy {
|
|||
handleErrorWithAlert(alertType: string, alertTitle: string, errURL: string, err: { status: number, error: any }) {
|
||||
this.logger.error(err);
|
||||
if (err.status === 401) {
|
||||
this.logger.info('Redirecting to Signin');
|
||||
this.store.dispatch(new RTLActions.Signout());
|
||||
this.logger.info('Redirecting to Login');
|
||||
this.store.dispatch(new RTLActions.Logout());
|
||||
} else {
|
||||
this.store.dispatch(new RTLActions.CloseSpinner());
|
||||
this.store.dispatch(new RTLActions.OpenAlert({
|
||||
|
|
Loading…
Add table
Reference in a new issue