mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
User password encrypted
This commit is contained in:
@@ -12,6 +12,7 @@ import { LocalstoreService } from '../store/localstore.service';
|
||||
import { ToastService } from './toast.service';
|
||||
import { UserStore } from 'src/app/store/user.service'
|
||||
import { SHA1, SHA256, AES, enc } from 'crypto-js'
|
||||
import { AESEncrypt } from '../services/aesencrypt.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -33,6 +34,7 @@ export class AuthService {
|
||||
public alertController: AlertController,
|
||||
private localstoreService: LocalstoreService,
|
||||
private toastService: ToastService,
|
||||
private aesencrypt: AESEncrypt,
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -51,7 +53,7 @@ export class AuthService {
|
||||
async login(user: UserForm): Promise<boolean> {
|
||||
// user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password);
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.username + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||
console.log('Basic ' + btoa(user.username + ':' + SHA1(user.password).toString())); //conversão em base64 das credenciais inseridas
|
||||
console.log('Basic ' + btoa(user.username + ':' + this.aesencrypt.encrypt(user.password,user.username ))); //conversão em base64 das credenciais inseridas
|
||||
|
||||
|
||||
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
|
||||
|
||||
Reference in New Issue
Block a user