From a761ba1a06c40256c30588a33a66dc8ce245d693 Mon Sep 17 00:00:00 2001
From: Daniel Krol <orblivion@gmail.com>
Date: Wed, 4 May 2022 18:14:46 -0400
Subject: [PATCH] Remove jwtPost from backend-api in identity service

---
 src/app/backend-api.service.ts | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/src/app/backend-api.service.ts b/src/app/backend-api.service.ts
index e4809bb..b2afa9e 100644
--- a/src/app/backend-api.service.ts
+++ b/src/app/backend-api.service.ts
@@ -1,10 +1,8 @@
-import { Injectable } from '@angular/core';
+import {Injectable} from '@angular/core';
 import {HttpClient} from '@angular/common/http';
 import {Observable, of} from 'rxjs';
 import {catchError, map} from 'rxjs/operators';
 import {environment} from '../environments/environment';
-import {SigningService} from './signing.service';
-import {AccountService} from './account.service';
 import {CryptoService} from './crypto.service';
 import {GlobalVarsService} from './global-vars.service';
 
@@ -26,8 +24,6 @@ export class BackendAPIService {
   constructor(
     private httpClient: HttpClient,
     private cryptoService: CryptoService,
-    private signingService: SigningService,
-    private accountService: AccountService,
     private globalVars: GlobalVarsService,
   ) { }
 
@@ -35,17 +31,6 @@ export class BackendAPIService {
     return this.httpClient.post<any>(`${this.endpoint}/${path}`, body);
   }
 
-  jwtPost(path: string, publicKey: string, body: any): Observable<any> {
-    const publicUserInfo = this.accountService.getEncryptedUsers()[publicKey];
-    if (!publicUserInfo) {
-      return of(null);
-    }
-
-    const seedHex = this.cryptoService.decryptSeedHex(publicUserInfo.encryptedSeedHex, this.globalVars.hostname);
-    const jwt = this.signingService.signJWT(seedHex);
-    return this.post(path, {...body, ...{JWT: jwt}});
-  }
-
   GetUsersStateless(
     publicKeys: string[]
   ): Observable<{ UserList: User[]}> {