Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
1cef11c5
Commit
1cef11c5
authored
Jan 30, 2020
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
S53525056 # Client - Incoming Issues #SMS Issues
parent
4ffb5a38
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
17 deletions
+20
-17
app.routing.ts
frontend/angular/src/app/app.routing.ts
+2
-2
auth.guard.ts
frontend/angular/src/app/oneit/guards/auth.guard.ts
+18
-15
No files found.
frontend/angular/src/app/app.routing.ts
View file @
1cef11c5
...
...
@@ -124,12 +124,12 @@ export const routes: Routes = [
]
},
{
path
:
'applicant/:job'
,
path
:
'applicant/:job
/job/:jobId
'
,
component
:
ApplicantPortalLayoutComponent
,
canActivate
:
[
AuthGuard
],
data
:
{
privs
:
[
'TL_AccessApplicantPortal'
],
redirectPage
:
'ApplicantPortal-ApplyJob.htm?cms.rm=SignIn&JobID=:job'
redirectPage
:
'ApplicantPortal-ApplyJob.htm?cms.rm=SignIn&JobID=:job
Id
'
},
children
:
[
{
...
...
frontend/angular/src/app/oneit/guards/auth.guard.ts
View file @
1cef11c5
...
...
@@ -9,7 +9,6 @@ import { ApiService } from '../services/api.service';
import
{
UserService
}
from
'../services/user.service'
;
import
{
UtilsService
}
from
'../services/utils.service'
;
@
Injectable
()
export
class
AuthGuard
implements
CanActivate
{
constructor
(
...
...
@@ -24,41 +23,45 @@ export class AuthGuard implements CanActivate {
canActivate
(
route
:
ActivatedRouteSnapshot
,
state
:
RouterStateSnapshot
):
Observable
<
boolean
>
{
le
t
params
=
{
cons
t
params
=
{
environment
:
environment
.
envName
,
queryType
:
"All"
}
queryType
:
'All'
}
;
return
this
.
apiService
.
post
(
`svc/EnvironmentInformation`
,
params
).
map
(
(
data
)
=>
{
return
this
.
apiService
.
post
(
'svc/EnvironmentInformation'
,
params
)
.
map
(
data
=>
{
if
(
this
.
utilServices
.
isSuccessfulResponse
(
data
))
{
let
redirectPage
=
route
.
data
[
"redirectPage"
]
||
"editor/"
;
let
redirectPage
=
route
.
data
.
redirectPage
||
'editor/'
;
this
.
userService
.
setDetailsFromData
(
data
);
if
(
data
.
UserName
==
"noprivauthtoken"
)
{
if
(
data
.
UserName
===
'noprivauthtoken'
)
{
const
url
=
window
.
location
.
href
;
const
matches
=
url
.
match
(
/applicant
\/(\d
+
)\/
message-engine/
);
const
matches
=
url
.
match
(
/job
\/(\d
+
)\/
message-engine/
);
if
(
matches
[
1
])
{
redirectPage
=
redirectPage
.
replace
(
':job'
,
matches
[
1
]);
redirectPage
=
redirectPage
.
replace
(
':jobId'
,
matches
[
1
]);
window
.
location
.
href
=
(
environment
.
baseUrl
+
redirectPage
);
return
false
;
}
window
.
location
.
href
=
(
environment
.
baseUrl
+
redirectPage
+
"?url="
+
encodeURIComponent
(
url
));
window
.
location
.
href
=
(
`
${
environment
.
baseUrl
+
redirectPage
}
?url=
${
encodeURIComponent
(
url
)}
`
);
return
false
;
}
else
{
let
privs
=
route
.
data
[
"privs"
]
as
Array
<
string
>
;
const
privs
=
route
.
data
.
privs
as
Array
<
string
>
;
if
(
privs
)
{
if
(
!
this
.
userService
.
hasPrivilegeFromMultiple
(
privs
))
{
this
.
router
.
navigate
([
'access-denied'
]);
}
}
//localStorage.setItem('userid', data.UserID);
// localStorage.setItem('userid', data.UserID);
return
true
;
}
}
}
)
.
catch
(
(
err
)
=>
of
(
false
)
.
catch
(()
=>
of
(
false
)
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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