Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bcgov/nr-silva-webapp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1b55beb7b5f2cc991ce015bb500a2a0ca87e48c5
Choose a base ref
..
head repository: bcgov/nr-silva-webapp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2e443427ef61f213100fafa717a195f6b2d405a5
Choose a head ref
Showing with 17 additions and 79 deletions.
  1. +0 −2 frontend/src/App.tsx
  2. +2 −2 frontend/src/screens/Landing/index.tsx
  3. +0 −4 frontend/src/screens/Login/Landing.scss
  4. +0 −69 frontend/src/screens/Login/index.tsx
  5. +15 −2 frontend/src/services/AuthService.ts
2 changes: 0 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ import Help from "./screens/Help";
import Reports from './screens/Reports';
import TopLayout from './layouts/TopLayout';
import SideLayout from './layouts/SideLayout';
import Login from './screens/Login';
import Dashboard from './screens/Dashboard';
import PostLoginRoute from './routes/PostLoginRoute';
import ProtectedRoute from './routes/ProtectedRoute';
@@ -29,7 +28,6 @@ const App: React.FC = () => {
<SideLayout pageContent={<Dashboard/>} />
</PostLoginRoute>
} />
<Route path="/login" element={<TopLayout pageContent={<Login/>} />} />
<Route path="/reports" element={
<ProtectedRoute signed={true}>
<SideLayout pageContent={<Reports/>} />
4 changes: 2 additions & 2 deletions frontend/src/screens/Landing/index.tsx
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ const Landing: React.FC = () => {
<div className="row gy-3">
<div className="col-xl-5 col-lg-6">
<Button
onClick={signIn}
onClick={()=>signIn('idir')}
renderIcon={Login}
data-testid="landing-button__idir"
className="btn-landing"
@@ -77,7 +77,7 @@ const Landing: React.FC = () => {
<div className="col-xl-5 col-lg-6 ">
<Button
kind="tertiary"
onClick={() => { console.log("Hi BCEid was clicked") }}
onClick={() => {signIn('bceid')}}
renderIcon={Login}
data-testid="landing-button__bceid"
className="btn-landing"
4 changes: 0 additions & 4 deletions frontend/src/screens/Login/Landing.scss

This file was deleted.

69 changes: 0 additions & 69 deletions frontend/src/screens/Login/index.tsx

This file was deleted.

17 changes: 15 additions & 2 deletions frontend/src/services/AuthService.ts
Original file line number Diff line number Diff line change
@@ -10,8 +10,21 @@ export interface FamLoginUser {
authToken?: CognitoUserSession;
}

export const signIn = async () => {
Auth.federatedSignIn();
export const signIn = async (provider:String) => {
if(provider.localeCompare('idir') === 0){
Auth.federatedSignIn({
customProvider:'DEV-IDIR'
});
}
else if(provider.localeCompare('bceid') === 0){
Auth.federatedSignIn({
customProvider:'DEV-BCEIDBUSINESS'
});
}
//else if invalid option passed logout the user
else{
logout();
}
};

export const isLoggedIn = () =>{