Skip to content

Commit

Permalink
Make the cancel button go to the logout path
Browse files Browse the repository at this point in the history
That should force the user to be logged out and redirect the user to the
frontpage
  • Loading branch information
spaceo committed Oct 18, 2023
1 parent 0fecf52 commit 4ca7667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/apps/create-patron-user-info/CreatePatron.dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default {
defaultValue: "https://login.bib.dk/userinfo",
control: { type: "text" }
},
logOutUrl: {
defaultValue: "/Logout",
control: { type: "text" }
},
textNotificationsEnabledConfig: {
defaultValue: "1",
control: { type: "text" }
Expand Down
6 changes: 4 additions & 2 deletions src/apps/create-patron-user-info/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface UserInfoProps {

const UserInfo: FC<UserInfoProps> = ({ cpr }) => {
const t = useText();
const { logoutUrl } = useUrls();
const config = useConfig();
const formRef = useRef<HTMLFormElement>(null);
const { redirectOnUserCreatedUrl } = useUrls();
Expand Down Expand Up @@ -104,8 +105,9 @@ const UserInfo: FC<UserInfoProps> = ({ cpr }) => {
<button
type="button"
className="link-tag mx-16"
// todo, click cancel, what then?
onClick={() => {}}
onClick={() => {
redirectTo(logoutUrl);
}}
>
{t("createPatronCancelButtonText")}
</button>
Expand Down

0 comments on commit 4ca7667

Please sign in to comment.