generated from garronej/keycloakify-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add logout-confirm * feat: add logout-confirm * fix * clean * cleanup * cleanup
- Loading branch information
Julien Bouquillon
committed
Jul 7, 2022
1 parent
e76c831
commit bf11ad5
Showing
7 changed files
with
163 additions
and
61 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,75 @@ | ||
import { memo } from "react"; | ||
import { getMsg, KcContextBase, KcProps } from "keycloakify"; | ||
import { useCssAndCx } from "tss-react"; | ||
import { Template } from "./Template"; | ||
|
||
export const LogoutConfirm = memo( | ||
({ | ||
kcContext, | ||
...props | ||
}: { kcContext: KcContextBase.LogoutConfirm } & KcProps) => { | ||
const { url, client, logoutConfirm } = kcContext; | ||
|
||
const { msg, msgStr } = getMsg(kcContext); | ||
|
||
const { cx } = useCssAndCx(); | ||
|
||
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)} | ||
> | ||
<button | ||
tabIndex={4} | ||
type="submit" | ||
className="fr-btn fr-btn--lg" | ||
name="confirmLogout" | ||
id="kc-logout" | ||
> | ||
{msgStr("doLogout")} | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
<div id="kc-info-message"> | ||
{!logoutConfirm.skipLink && client.baseUrl && ( | ||
<p style={{ marginTop: 20 }}> | ||
<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
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