Skip to content

Commit

Permalink
Do not show anything in create patron app if anonymous
Browse files Browse the repository at this point in the history
The hosting application/site should handle this situation
  • Loading branch information
spaceo committed Oct 10, 2023
1 parent 4afdff0 commit f87dd9c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/apps/create-patron-user-info/CreatePatron.entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,12 @@ export interface CreatePatronProps
const CreatePatronEntry: FC<CreatePatronProps> = () => {
const userToken = hasToken("user") ? getToken("user") : null;

// The application using this app should handle the case where the user is not logged in.
// Eg by returning 403 Forbidden or redirecting to the login page.
if (!userToken) {
return (
<>
<h2>Please Log ind..</h2>
<p>
When the flash message/info bar has been implemented, we will use it
here to tell the user to log in.
</p>
</>
);
return null;
}

return <CreatePatron userToken={userToken} />;
};

Expand Down

0 comments on commit f87dd9c

Please sign in to comment.