Browse Source

hash over http

master
peter 5 years ago
parent
commit
b01a06fa10
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      src/frontend/src/app/frontcraft/services/login-api.ts

+ 2
- 3
src/frontend/src/app/frontcraft/services/login-api.ts View File

5
 import { CookieService } from 'ngx-cookie-service';
5
 import { CookieService } from 'ngx-cookie-service';
6
 import { Router } from '@angular/router';
6
 import { Router } from '@angular/router';
7
 import { ShoutMessage } from '../../../../../backend/Components/Shoutbox/Interface';
7
 import { ShoutMessage } from '../../../../../backend/Components/Shoutbox/Interface';
8
+import { saltedHash } from '../../../../../backend/Util/hash';
8
 
9
 
9
 @Injectable()
10
 @Injectable()
10
 export class ApiService{
11
 export class ApiService{
142
 }
143
 }
143
 
144
 
144
 export async function hash(value:string) : Promise<string>{
145
 export async function hash(value:string) : Promise<string>{
145
-    const buf = str2arraybuf(value)
146
-    const pwHash = await crypto.subtle.digest('SHA-256', buf);
147
-    return buf2hex(pwHash)
146
+    return saltedHash(value, "")
148
 }
147
 }
149
 
148
 
150
 //angular depenency manager requires this
149
 //angular depenency manager requires this

Loading…
Cancel
Save