fixed login button changed hash to sha512

master
Max 5 years ago
parent 460821d0f3
commit 0a4a59e6d6

5
package-lock.json generated

@ -5808,6 +5808,11 @@
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==",
"optional": true "optional": true
}, },
"js-sha512": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz",
"integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ=="
},
"js-tokens": { "js-tokens": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",

@ -30,6 +30,7 @@
"core-js": "^2.5.4", "core-js": "^2.5.4",
"graphql": "^14.3.1", "graphql": "^14.3.1",
"graphql-tag": "^2.10.0", "graphql-tag": "^2.10.0",
"js-sha512": "^0.8.0",
"ngx-socket-io": "^2.0.0", "ngx-socket-io": "^2.0.0",
"rxjs": "~6.3.3", "rxjs": "~6.3.3",
"ts-md5": "^1.2.6", "ts-md5": "^1.2.6",

@ -11,7 +11,7 @@
<td> <input #password type="password" name="password"><br></td> <td> <input #password type="password" name="password"><br></td>
</tr> </tr>
</table> </table>
<button type="loginbutton" (onClick)="onClickSubmit(email.value,password.value)">Login</button> <button type="loginbutton" (click)="onClickSubmit(email.value,password.value)">Login</button>
<p *ngIf="errorOccurred">{{errorMessage}}</p> <p *ngIf="errorOccurred">{{errorMessage}}</p>
<br> <br>
<br> <br>

@ -1,9 +1,8 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Login } from 'src/app/models/login'; import { Login } from 'src/app/models/login';
import { LoginService } from 'src/app/services/login/login.service'; import { LoginService } from 'src/app/services/login/login.service';
import { RouterLink } from '@angular/router';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {Md5} from 'ts-md5/dist/md5'; import * as sha512 from 'js-sha512';
@Component({ @Component({
selector: 'app-login', selector: 'app-login',
@ -30,8 +29,8 @@ export class LoginComponent implements OnInit {
this.errorOccurred = false; this.errorOccurred = false;
this.errorMessage = " "; this.errorMessage = " ";
this.login.email = pEmail this.login.email = pEmail
const md5 = new Md5(); this.login.passwordHash = sha512.sha512(pPasswordHash);
this.login.passwordHash = md5.appendStr(pPasswordHash).end() as string console.log(this.login.passwordHash);
this.loginService.login(this.login, error => this.loginError(error.json())); this.loginService.login(this.login, error => this.loginError(error.json()));
} }

@ -4,6 +4,7 @@ import {Registration} from '../../models/registration';
import {Router} from '@angular/router'; import {Router} from '@angular/router';
import {Md5} from 'ts-md5/dist/md5'; import {Md5} from 'ts-md5/dist/md5';
import { parseWebDriverCommand } from 'blocking-proxy/built/lib/webdriver_commands'; import { parseWebDriverCommand } from 'blocking-proxy/built/lib/webdriver_commands';
import * as sha512 from 'js-sha512';
@Component({ @Component({
selector: 'registration', selector: 'registration',
@ -31,8 +32,7 @@ export class RegisterComponent implements OnInit {
if(this.passwordSame(pPasswordHash,pPasswordHashRepeat)){ if(this.passwordSame(pPasswordHash,pPasswordHashRepeat)){
this.registration.username = pUsername this.registration.username = pUsername
this.registration.email = pEmail this.registration.email = pEmail
const md5 = new Md5(); this.registration.passwordHash = sha512.sha512(pPasswordHash);
this.registration.passwordHash = md5.appendStr(pPasswordHash).end() as string
this.registerService.register(this.registration, error => this.registerError(error.json())); this.registerService.register(this.registration, error => this.registerError(error.json()));
} }
} }

Loading…
Cancel
Save