Merge branch 'max_dev' of Software_Engineering_I/greenvironment-frontend into master

master
Max_ES 5 years ago committed by Gitea
commit 8c711b0d6c

5
package-lock.json generated

@ -5808,6 +5808,11 @@
"integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==",
"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": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",

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

@ -11,7 +11,7 @@
<td> <input #password type="password" name="password"><br></td>
</tr>
</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>
<br>
<br>

@ -1,9 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Login } from 'src/app/models/login';
import { LoginService } from 'src/app/services/login/login.service';
import { RouterLink } from '@angular/router';
import {Router} from '@angular/router';
import {Md5} from 'ts-md5/dist/md5';
import * as sha512 from 'js-sha512';
@Component({
selector: 'app-login',
@ -30,8 +29,8 @@ export class LoginComponent implements OnInit {
this.errorOccurred = false;
this.errorMessage = " ";
this.login.email = pEmail
const md5 = new Md5();
this.login.passwordHash = md5.appendStr(pPasswordHash).end() as string
this.login.passwordHash = sha512.sha512(pPasswordHash);
console.log(this.login.passwordHash);
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 {Md5} from 'ts-md5/dist/md5';
import { parseWebDriverCommand } from 'blocking-proxy/built/lib/webdriver_commands';
import * as sha512 from 'js-sha512';
@Component({
selector: 'registration',
@ -31,8 +32,7 @@ export class RegisterComponent implements OnInit {
if(this.passwordSame(pPasswordHash,pPasswordHashRepeat)){
this.registration.username = pUsername
this.registration.email = pEmail
const md5 = new Md5();
this.registration.passwordHash = md5.appendStr(pPasswordHash).end() as string
this.registration.passwordHash = sha512.sha512(pPasswordHash);
this.registerService.register(this.registration, error => this.registerError(error.json()));
}
}

Loading…
Cancel
Save