forked from AOT-Technologies/forms-flow-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AOT-Technologies#2068 from abilpraju-aot/bugfix/FW…
…F-3342-Auth-issue Autherization for role check
- Loading branch information
Showing
5 changed files
with
82 additions
and
9 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
forms-flow-web/src/components/AccessDenied/AccessDenied.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
forms-flow-web/src/components/AccessDenied/accessDenied.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.access-denied-text { | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 2rem; | ||
color: var(--ff-black); | ||
opacity: 1; | ||
} | ||
.access-denied{ | ||
font-family: Arial, Helvetica, sans-serif; | ||
font-size: 1rem; | ||
color: var(--ff-black); | ||
opacity: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from "react"; | ||
import { kcServiceInstance } from "../PrivateRoute"; // Import the kcServiceInstance function | ||
import accessDeniedIcon from "./AccessDenied.svg"; | ||
import './accessDenied.scss'; | ||
import { useTranslation } from "react-i18next"; | ||
const AccessDenied = () => { | ||
const { t } = useTranslation(); | ||
const handleLogout = () => { | ||
const kcInstance = kcServiceInstance(); // Get the Keycloak instance | ||
kcInstance.userLogout(); | ||
}; | ||
|
||
return ( | ||
<div className="d-flex flex-column align-items-center text-center"> | ||
<img src={accessDeniedIcon} alt="Access Denied Icon" className="mb-4 mt-2"/> | ||
<h1 className="access-denied-text">{t("Access Denied")}</h1> | ||
<span className="access-denied">{t("You don't have permission to access this page.")}</span> | ||
<span className="access-denied">{t("Please contact your administrator or try again later.")}</span> | ||
<button className="btn btn-primary me-1 mt-4" onClick={handleLogout}>{t("Return to login")}</button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AccessDenied; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters