11import { ConfigurationContext } from "../context/configuration.js" ;
22import { ThemeContext } from "../context/theme.js" ;
33import { prepareAuthorizationParams , getPlaceholder , useTitle } from "../utils/utils.js" ;
4+ import { get } from "../utils/api.js" ;
45
56export default function ConsentScreen ( ) {
67 const configuration = React . useContext ( ConfigurationContext ) ;
@@ -17,12 +18,12 @@ export default function ConsentScreen() {
1718
1819 React . useEffect ( ( ) => {
1920 ( async ( ) => {
20- const clientInformation = await $ . get ( `/client/${ authParams . client_id } ` ) ;
21- const permissionsInformation = await $ . get ( "/user/scopes" ) ;
22- setClientInfo ( clientInformation . data . client ) ;
21+ const clientResult = await get ( `/client/${ authParams . client_id } ` ) ;
22+ const permissionsResult = await get ( "/user/scopes" ) ;
23+ setClientInfo ( clientResult . data . data . client ) ;
2324 setRequiredScopes ( authParams . scope . split ( "," ) ) ;
24- setPermissionsInfo ( permissionsInformation . data . scopes ) ;
25- console . log ( clientInformation . data , permissionsInformation . data ) ;
25+ setPermissionsInfo ( permissionsResult . data . data . scopes ) ;
26+ console . log ( clientResult . data . data , permissionsResult . data . data ) ;
2627 } ) ( ) ;
2728 } , [ ] ) ;
2829
@@ -33,9 +34,9 @@ export default function ConsentScreen() {
3334
3435 const onDeny = ( ) => {
3536 const redirectUri = new URL ( authParams . redirect_uri ) ;
36- redirectUri . searchParams . append ( ' error' , ' access_denied' ) ;
37- redirectUri . searchParams . append ( ' error_description' , ' Access was denied by the user' ) ;
38- redirectUri . searchParams . append ( ' state' , authParams . state ) ;
37+ redirectUri . searchParams . append ( " error" , " access_denied" ) ;
38+ redirectUri . searchParams . append ( " error_description" , " Access was denied by the user" ) ;
39+ redirectUri . searchParams . append ( " state" , authParams . state ) ;
3940 window . location = redirectUri ;
4041 } ;
4142
@@ -45,7 +46,8 @@ export default function ConsentScreen() {
4546 < div className = "form" >
4647 < div className = "noselect" >
4748 < h3 className = "long-header" >
48- { i18next . t ( "heading.consent" ) } < span className = "header-separator" > • </ span >
49+ { i18next . t ( "heading.consent" ) }
50+ < span className = "header-separator" > • </ span >
4951 { configuration [ `assets.header-icon-${ theme } ` ] ? (
5052 < div className = "app-icon-header" >
5153 < div style = { { display : miniIconLoaded ? "none" : "block" } } className = "spinner" />
@@ -61,9 +63,7 @@ export default function ConsentScreen() {
6163 ) }
6264 </ h3 >
6365 < div className = "consent-form" >
64- < p >
65- { i18next . t ( "message.consent" , { app_name : clientInfo . displayName } ) }
66- </ p >
66+ < p > { i18next . t ( "message.consent" , { app_name : clientInfo . displayName } ) } </ p >
6767 < ul className = "scope-container" >
6868 { requiredScopes . map ( ( scope ) => (
6969 < li className = "scope-item" key = { scope } >
@@ -74,9 +74,7 @@ export default function ConsentScreen() {
7474 </ li >
7575 ) ) }
7676 </ ul >
77- < p className = "fineprint" >
78- { i18next . t ( "message.consent-warning" ) }
79- </ p >
77+ < p className = "fineprint" > { i18next . t ( "message.consent-warning" ) } </ p >
8078 </ div >
8179 </ div >
8280 < div className = "page-links" > </ div >
0 commit comments