Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-frontend
Commits
2c56b0c9
Commit
2c56b0c9
authored
2 years ago
by
Hamza Touizrat
Browse files
Options
Downloads
Plain Diff
Merge branch 'new_signup' into 'master'
add See merge request
!81
parents
c5b10345
be8fc32c
Branches
Branches containing commit
No related tags found
1 merge request
!81
add
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/login/login.component.ts
+28
-42
28 additions, 42 deletions
src/app/login/login.component.ts
src/app/signup/student-signup/student-signup.component.html
+2
-2
2 additions, 2 deletions
src/app/signup/student-signup/student-signup.component.html
with
30 additions
and
44 deletions
src/app/login/login.component.ts
+
28
−
42
View file @
2c56b0c9
...
...
@@ -18,7 +18,7 @@ export class LoginComponent implements OnInit {
defaultRedirectUrl
:
string
=
'
/membres
'
;
charterUrl
:
string
=
'
inscription/student-charter
'
;
formGroup
:
FormGroup
;
loginSuccess
:
boolean
=
fals
e
;
loginSuccess
:
boolean
=
tru
e
;
constructor
(
private
router
:
Router
,
...
...
@@ -50,43 +50,31 @@ export class LoginComponent implements OnInit {
this
.
loading
=
true
;
const
{
email
,
password
}
=
this
.
formGroup
.
value
;
this
.
messageService
.
clear
();
await
this
.
auth
.
login
(
email
,
password
).
pipe
(
map
(()
=>
this
.
loginSuccess
=
true
),
await
this
.
auth
.
checkSignatureCharter
(
email
).
pipe
(
catchError
(()
=>
{
this
.
messageService
.
error
(
"
L'identifiant ou le mot de passe est incorrect.
"
);
this
.
loginSuccess
=
false
;
this
.
hassignedCharter
=
false
;
return
of
(
false
);
}),
tap
(()
=>
this
.
loading
=
false
),
map
(()
=>
this
.
loginSuccess
=
true
),
// Only continue if no error
filter
(
Boolean
),
// Get redirect URL from the auth service, provided by the auth guard.
).
toPromise
();
).
subscribe
({
complete
()
{
console
.
log
(
"
login unsuccess
"
);
},
});
await
this
.
auth
.
login
(
email
,
password
).
toPromise
().
catch
(()
=>
{
console
.
log
(
"
this.loginSuccess)
"
);
this
.
messageService
.
error
(
"
L'identifiant ou le mot de passe est incorrect.
"
);
tap
(()
=>
this
.
snackBar
.
open
(
"
L'identifiant ou le mot de passe est incorrect.
"
,
'
OK
'
,
{
duration
:
2000
})),
if
(
this
.
loginSuccess
==
true
){
this
.
loginSuccess
=
false
;
this
.
loading
=
false
;
return
of
(
false
);
});
this
.
auth
.
checkSignatureCharter
(
email
).
pipe
(
catchError
(()
=>
{
this
.
hassignedCharter
=
false
;
if
(
this
.
loginSuccess
)
{
this
.
messageService
.
error
(
"
Vous n'avez pas signé le(s) charte(s).
"
);
map
(()
=>
this
.
auth
.
redirectUrl
?
this
.
auth
.
redirectUrl
:
this
.
defaultRedirectUrl
),
tap
((
redirectUrl
:
string
)
=>
this
.
router
.
navigate
([
redirectUrl
]));
return
of
(
false
);
}),
map
(()
=>
this
.
auth
.
redirectUrl
?
this
.
auth
.
redirectUrl
:
this
.
defaultRedirectUrl
),
tap
(()
=>
this
.
snackBar
.
open
(
'
Connexion réussie !
'
,
'
OK
'
,
{
duration
:
2000
})),
).
subscribe
().
add
(()
=>
{
this
.
loading
=
false
;
console
.
log
(
this
.
loginSuccess
);
if
(
this
.
hassignedCharter
==
false
)
{
this
.
router
.
navigate
([
this
.
charterUrl
]);
...
...
@@ -95,8 +83,6 @@ export class LoginComponent implements OnInit {
{
this
.
router
.
navigate
([
this
.
defaultRedirectUrl
]);
}
});
}
}
}
\ No newline at end of file
}}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/signup/student-signup/student-signup.component.html
+
2
−
2
View file @
2c56b0c9
...
...
@@ -33,12 +33,12 @@
<!--
<mat-form-field class="full-width">
<mat-form-field
class=
"full-width"
>
<input
matInput
type=
"tel"
minlength=
"10"
maxlength=
"10"
formControlName=
"phoneNumber"
placeholder=
"Numéro de téléphone"
required
>
<mat-hint>
Il nous permettra de te contacter en cas de nécessité.
</mat-hint>
</mat-form-field>
-->
</mat-form-field>
<p>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment