Commit 96b59bf1 by Matteo

Sistemata validazione form

parent cfccc86b
......@@ -37,6 +37,8 @@
<string>$PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$PHOTO_LIBRARY_USAGE_DESCRIPTION</string>
<key>NSCameraUsageDescription</key>
<string>Abbiamo bisogno dell'accesso alla fotocamera per poter inviare foto insieme alla richiesta pareri</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
......
......@@ -55,10 +55,10 @@
<ion-input formControlName="cellulare" type="tel" placeholder="{{ 'cellulare' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="password" type="password" placeholder="{{ 'pwd' | translate }}" ngModel required></ion-input>
<ion-input formControlName="newpassword" type="password" placeholder="{{ 'pwd' | translate }}" ngModel required></ion-input>
</ion-item>
<ion-item>
<ion-input formControlName="passwordbis" type="password" placeholder="{{ 'repeat_pwd' | translate }}" ngModel required></ion-input>
<ion-input formControlName="newpasswordbis" type="password" placeholder="{{ 'repeat_pwd' | translate }}" ngModel required></ion-input>
</ion-item>
</div>
<div padding>
......
......@@ -79,12 +79,12 @@ export class RegistrazionePage implements OnInit {
cellulare: new FormControl('', Validators.compose([
Validators.pattern('^[0-9]+$'),
])),
password: new FormControl('', Validators.compose([
newpassword: new FormControl('', Validators.compose([
Validators.minLength(5),
Validators.required,
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]+$') //this is for the letters (both uppercase and lowercase) and numbers validation
])),
passwordbis: new FormControl('', Validators.compose([
newpasswordbis: new FormControl('', Validators.compose([
Validators.required
]))
},(formGroup: FormGroup) => {
......
......@@ -158,7 +158,7 @@ export class AuthService {
registra(value) : Observable<ErrorResponse>{
this.tipoStruttura = environment.struttura;
var param = UtilService.encodeBody({nome: value.nome, cognome: value.cognome, email: value.email, cellulare: value.cellulare, password: value.password, tipostruttura: this.tipoStruttura});
var param = UtilService.encodeBody({nome: value.nome, cognome: value.cognome, email: value.email, cellulare: value.cellulare, password: value.newpassword, tipostruttura: this.tipoStruttura});
this.clientiSalvati = false;
return this.httpClient.post<ErrorResponse>(this.httpClientDataService.BASE_ADDRESS+'/autenticazione/registrazione.do', param, this.httpClientDataService.httpOptions)
.pipe(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment