generated from garronej/ts-ci
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 #120 from revolunet/logout
feat: add logout-confirm
- Loading branch information
Showing
6 changed files
with
100 additions
and
3 deletions.
There are no files selected for viewing
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
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,61 @@ | ||
import { memo } from "react"; | ||
import { useCssAndCx } from "tss-react"; | ||
|
||
import { Template } from "./Template"; | ||
import type { KcProps } from "./KcProps"; | ||
import type { KcContextBase } from "../getKcContext/KcContextBase"; | ||
import { getMsg } from "../i18n"; | ||
|
||
export const LogoutConfirm = memo(({ kcContext, ...props }: { kcContext: KcContextBase.LogoutConfirm } & KcProps) => { | ||
const { url, client, logoutConfirm } = kcContext; | ||
|
||
const { cx } = useCssAndCx(); | ||
|
||
const { msg, msgStr } = getMsg(kcContext); | ||
|
||
return ( | ||
<Template | ||
{...{ kcContext, ...props }} | ||
doFetchDefaultThemeResources={true} | ||
displayMessage={false} | ||
headerNode={msg("logoutConfirmTitle")} | ||
formNode={ | ||
<> | ||
<div id="kc-logout-confirm" className="content-area"> | ||
<p className="instruction">{msg("logoutConfirmHeader")}</p> | ||
<form className="form-actions" action={url.logoutConfirmAction} method="POST"> | ||
<input type="hidden" name="session_code" value={logoutConfirm.code} /> | ||
<div className={cx(props.kcFormGroupClass)}> | ||
<div id="kc-form-options"> | ||
<div className={cx(props.kcFormOptionsWrapperClass)}></div> | ||
</div> | ||
<div id="kc-form-buttons" className={cx(props.kcFormGroupClass)}> | ||
<input | ||
tabIndex={4} | ||
className={cx( | ||
props.kcButtonClass, | ||
props.kcButtonPrimaryClass, | ||
props.kcButtonBlockClass, | ||
props.kcButtonLargeClass, | ||
)} | ||
name="confirmLogout" | ||
id="kc-logout" | ||
type="submit" | ||
value={msgStr("doLogout")} | ||
/> | ||
</div> | ||
</div> | ||
</form> | ||
<div id="kc-info-message"> | ||
{!logoutConfirm.skipLink && client.baseUrl && ( | ||
<p> | ||
<a href={client.baseUrl} dangerouslySetInnerHTML={{ __html: msgStr("backToApplication") }} /> | ||
</p> | ||
)} | ||
</div> | ||
</div> | ||
</> | ||
} | ||
/> | ||
); | ||
}); |
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
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