This repository was archived by the owner on Aug 19, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +17
-79
lines changed Expand file tree Collapse file tree 5 files changed +17
-79
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import Help from "./screens/Help";
12
12
import Reports from './screens/Reports' ;
13
13
import TopLayout from './layouts/TopLayout' ;
14
14
import SideLayout from './layouts/SideLayout' ;
15
- import Login from './screens/Login' ;
16
15
import Dashboard from './screens/Dashboard' ;
17
16
import PostLoginRoute from './routes/PostLoginRoute' ;
18
17
import ProtectedRoute from './routes/ProtectedRoute' ;
@@ -29,7 +28,6 @@ const App: React.FC = () => {
29
28
< SideLayout pageContent = { < Dashboard /> } />
30
29
</ PostLoginRoute >
31
30
} />
32
- < Route path = "/login" element = { < TopLayout pageContent = { < Login /> } /> } />
33
31
< Route path = "/reports" element = {
34
32
< ProtectedRoute signed = { true } >
35
33
< SideLayout pageContent = { < Reports /> } />
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const Landing: React.FC = () => {
66
66
< div className = "row gy-3" >
67
67
< div className = "col-xl-5 col-lg-6" >
68
68
< Button
69
- onClick = { signIn }
69
+ onClick = { ( ) => signIn ( 'idir' ) }
70
70
renderIcon = { Login }
71
71
data-testid = "landing-button__idir"
72
72
className = "btn-landing"
@@ -77,7 +77,7 @@ const Landing: React.FC = () => {
77
77
< div className = "col-xl-5 col-lg-6 " >
78
78
< Button
79
79
kind = "tertiary"
80
- onClick = { ( ) => { console . log ( "Hi BCEid was clicked" ) } }
80
+ onClick = { ( ) => { signIn ( 'bceid' ) } }
81
81
renderIcon = { Login }
82
82
data-testid = "landing-button__bceid"
83
83
className = "btn-landing"
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,8 +10,21 @@ export interface FamLoginUser {
10
10
authToken ?: CognitoUserSession ;
11
11
}
12
12
13
- export const signIn = async ( ) => {
14
- Auth . federatedSignIn ( ) ;
13
+ export const signIn = async ( provider :String ) => {
14
+ if ( provider . localeCompare ( 'idir' ) === 0 ) {
15
+ Auth . federatedSignIn ( {
16
+ customProvider :'DEV-IDIR'
17
+ } ) ;
18
+ }
19
+ else if ( provider . localeCompare ( 'bceid' ) === 0 ) {
20
+ Auth . federatedSignIn ( {
21
+ customProvider :'DEV-BCEIDBUSINESS'
22
+ } ) ;
23
+ }
24
+ //else if invalid option passed logout the user
25
+ else {
26
+ logout ( ) ;
27
+ }
15
28
} ;
16
29
17
30
export const isLoggedIn = ( ) => {
You can’t perform that action at this time.
0 commit comments