Skip to content

Commit b41d63f

Browse files
author
Aashutosh
committed
update consent page
1 parent cd37b57 commit b41d63f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Consent.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,33 @@ import './ConsentForm.css'; // Import CSS file for styling
33

44
const ConsentForm = () => {
55
const [consentChallenge, setConsentChallenge] = useState('');
6+
const [scope, setScope] = useState('');
7+
const [appName, setAppName] = useState('');
68

79
useEffect(() => {
810
const searchParams = new URLSearchParams(window.location.search);
911
const consent_challenge = searchParams.get('consent_challenge');
12+
const scopeValue = searchParams.get('scope');
13+
const appNameValue = searchParams.get('appName');
1014
setConsentChallenge(consent_challenge);
15+
setScope(scopeValue);
16+
setAppName(appNameValue);
1117
}, []);
1218

19+
20+
1321
return (
1422
<>
1523
<div className="consent-container">
16-
<h1>Authorize An App</h1>
24+
<h1>Authorize {appName} App</h1>
1725
<div className="form-container">
1826
<form className="form-consent" method="post" action="http://localhost:8000/consent">
1927
<input type="hidden" name="consent_challenge" value={consentChallenge}/>
2028
<p className="scopes-text">This app is requesting access to the following scopes:</p>
2129
<div className="form-check">
2230
<input type="checkbox" name="grant_scope" id="offline-checkbox" value="offline" checked />
2331
<input type="hidden" name="grant_scope" value="offline" />
24-
<label htmlFor="offline-checkbox" className="form-check-label">Offline Access</label>
32+
<label htmlFor="offline-checkbox" className="form-check-label">{scope}</label>
2533
</div>
2634
<button className="btn btn-primary" type="submit">Authorize</button>
2735
</form>

0 commit comments

Comments
 (0)