Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalWebpage
Commits
d6b72c4f
Commit
d6b72c4f
authored
Mar 08, 2018
by
Lukas Burgey
Browse files
Add handling of a server error for the info endpoint
parent
8ce12a45
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/login/login.component.ts
View file @
d6b72c4f
...
...
@@ -20,6 +20,9 @@ export class LoginComponent {
)
{
this
.
userService
.
getIdPPreference
().
subscribe
(
(
allAuthInfo
:
AllAuthInfo
)
=>
{
if
(
allAuthInfo
===
null
)
{
return
;
}
this
.
idps
=
allAuthInfo
.
idps
;
this
.
selectedIdP
=
allAuthInfo
.
selected
;
}
...
...
src/app/user.service.ts
View file @
d6b72c4f
...
...
@@ -35,6 +35,12 @@ export class UserService {
this
.
cookieService
.
set
(
environment
.
idpCookieName
,
String
(
idp
.
id
));
}
public
errorHandler
(
error
:
any
):
void
{
if
(
error
.
status
===
500
)
{
this
.
snackBar
.
open
(
'
Server Error
'
);
}
}
public
getIdPPreference
():
Observable
<
AllAuthInfo
>
{
let
idpID
=
Number
(
this
.
cookieService
.
get
(
environment
.
idpCookieName
));
...
...
@@ -55,6 +61,11 @@ export class UserService {
selected
:
selected
,
};
}
).
catch
(
(
error
:
any
)
=>
{
this
.
errorHandler
(
error
);
return
Observable
.
of
(
null
);
}
);
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment