Feature Account theme customization

This commit is contained in:
garronej
2023-03-20 05:28:53 +01:00
parent 5b4aeca63c
commit 254bfccc62

View File

@ -8,18 +8,21 @@ const PUBLIC_URL = process.env["PUBLIC_URL"] ?? "/";
export const kcContextCommonMock: KcContext.Common = { export const kcContextCommonMock: KcContext.Common = {
"url": { "url": {
"loginAction": "#",
"resourcesPath": pathJoin(PUBLIC_URL, mockTestingResourcesPath), "resourcesPath": pathJoin(PUBLIC_URL, mockTestingResourcesPath),
"resourcesCommonPath": pathJoin(PUBLIC_URL, mockTestingResourcesCommonPath), "resourcesCommonPath": pathJoin(PUBLIC_URL, mockTestingResourcesCommonPath),
"loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg", "resourceUrl": "#",
"loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg" "accountUrl": "#",
"applicationsUrl": "#",
"getLogoutUrl": () => "#",
"logUrl": "#",
"passwordUrl": "#",
"sessionsUrl": "#",
"socialUrl": "#",
"totpUrl": "#"
}, },
"realm": { "realm": {
"name": "myrealm",
"displayName": "myrealm",
"displayNameHtml": "myrealm",
"internationalizationEnabled": true, "internationalizationEnabled": true,
"registrationEmailAsUsername": false "userManagedAccessAllowed": true
}, },
"messagesPerField": { "messagesPerField": {
"printIfExists": () => { "printIfExists": () => {
@ -126,20 +129,17 @@ export const kcContextCommonMock: KcContext.Common = {
], ],
"currentLanguageTag": "en" "currentLanguageTag": "en"
}, },
"auth": {
"showUsername": false,
"showResetCredentials": false,
"showTryAnotherWayLink": false
},
"client": {
"clientId": "myApp"
},
"scripts": [],
"message": { "message": {
"type": "success", "type": "success",
"summary": "This is a test message" "summary": "This is a test message"
}, },
"isAppInitiatedAction": false "features": {
"authorization": true,
"identityFederation": true,
"log": true,
"passwordUpdateSupported": true
},
"referrer": undefined
}; };
export const kcContextMocks: KcContext[] = [ export const kcContextMocks: KcContext[] = [
@ -149,5 +149,24 @@ export const kcContextMocks: KcContext[] = [
"password": { "password": {
"passwordSet": true "passwordSet": true
} }
}),
id<KcContext.Account>({
...kcContextCommonMock,
"pageId": "account.ftl",
"url": {
...kcContextCommonMock.url,
"referrerURI": "#",
"accountUrl": "#"
},
"realm": {
...kcContextCommonMock.realm,
"registrationEmailAsUsername": true,
"editUsernameAllowed": true
},
"stateChecker": "",
"account": {
"firstName": "john",
"lastName": "doe"
}
}) })
]; ];