Fix bad types in Account kcContext
This commit is contained in:
@ -28,11 +28,6 @@ export declare namespace KcContext {
|
|||||||
resourcesPath: string;
|
resourcesPath: string;
|
||||||
/** @deprecated, not present in recent keycloak version apparently, use kcContext.referrer instead */
|
/** @deprecated, not present in recent keycloak version apparently, use kcContext.referrer instead */
|
||||||
referrerURI?: string;
|
referrerURI?: string;
|
||||||
// Present only if redirected to account page with ?referrer=xxx&referrer_uri=http...
|
|
||||||
referrer?: {
|
|
||||||
url: string; // The url of the App
|
|
||||||
name: string; // NOTE: Client id
|
|
||||||
};
|
|
||||||
getLogoutUrl: () => string;
|
getLogoutUrl: () => string;
|
||||||
};
|
};
|
||||||
features: {
|
features: {
|
||||||
@ -45,13 +40,14 @@ export declare namespace KcContext {
|
|||||||
internationalizationEnabled: boolean;
|
internationalizationEnabled: boolean;
|
||||||
userManagedAccessAllowed: boolean;
|
userManagedAccessAllowed: boolean;
|
||||||
};
|
};
|
||||||
|
// Present only if redirected to account page with ?referrer=xxx&referrer_uri=http...
|
||||||
message?: {
|
message?: {
|
||||||
type: "success" | "warning" | "error" | "info";
|
type: "success" | "warning" | "error" | "info";
|
||||||
summary: string;
|
summary: string;
|
||||||
};
|
};
|
||||||
referrer?: {
|
referrer?: {
|
||||||
url?: string;
|
url: string; // The url of the App
|
||||||
name: string;
|
name: string; // Client id
|
||||||
};
|
};
|
||||||
messagesPerField: {
|
messagesPerField: {
|
||||||
printIfExists: <T>(fieldName: string, x: T) => T | undefined;
|
printIfExists: <T>(fieldName: string, x: T) => T | undefined;
|
||||||
|
@ -99,9 +99,7 @@ export default function Account(props: PageProps<Extract<KcContext, { pageId: "a
|
|||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<div id="kc-form-buttons" className="col-md-offset-2 col-md-10 submit">
|
<div id="kc-form-buttons" className="col-md-offset-2 col-md-10 submit">
|
||||||
<div>
|
<div>
|
||||||
{(referrer !== undefined || url.referrerURI !== undefined) && (
|
{referrer !== undefined && <a href={referrer?.url}>{msg("backToApplication")}</a>}
|
||||||
<a href={referrer?.url ?? url.referrerURI}>{msg("backToApplication")}</a>
|
|
||||||
)}
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
Reference in New Issue
Block a user