-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instead of forcing login, display a message offering users the chance…
… to login (#1082) * failing * updates * unexport * format * update * remove tests we no longer want * testing * Update index.spec.ts * update test * updates from code review * update * format * a space * fix test
- Loading branch information
1 parent
d12664d
commit dfff93e
Showing
9 changed files
with
75 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
import { getAuthUrl } from '../../middleware/authMiddleware'; | ||
import IcOutlineLogin from '~icons/ic/outline-login'; | ||
const loginUrl = await getAuthUrl(Astro.url.toString()); | ||
interface Props { | ||
message?: string; | ||
} | ||
let { message } = Astro.props; | ||
if (message === undefined) { | ||
message = 'You need to log in to access this page.'; | ||
} | ||
--- | ||
|
||
<div class='mt-6 alert max-w-4xl mx-auto'> | ||
<IcOutlineLogin className='w-12 h-12 inline-block mr-2' /> | ||
<div> | ||
<p>{message}</p> | ||
<a href={loginUrl} class='btn mt-3 bg-white hover:bg-gray-50'>Log in</a> | ||
<p class='mt-3'></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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
--- | ||
import { ReviewPage } from '../../../components/ReviewPage/ReviewPage'; | ||
import NeedToLogin from '../../../components/common/NeedToLogin.astro'; | ||
import { getRuntimeConfig } from '../../../config'; | ||
import BaseLayout from '../../../layouts/BaseLayout.astro'; | ||
import { type ClientConfig } from '../../../types/runtimeConfig'; | ||
import { getAccessToken } from '../../../utils/getAccessToken'; | ||
const organism = Astro.params.organism!; | ||
const accessToken = getAccessToken(Astro.locals.session)!; | ||
const clientConfig: ClientConfig = getRuntimeConfig().public; | ||
--- | ||
|
||
<BaseLayout title='Current submissions'> | ||
<h1 class='title'>Current submissions</h1> | ||
<ReviewPage clientConfig={clientConfig} organism={organism} accessToken={accessToken} client:load /> | ||
</BaseLayout> | ||
{ | ||
accessToken ? ( | ||
<BaseLayout title='Current submissions'> | ||
<h1 class='title'>Current submissions</h1> | ||
<ReviewPage clientConfig={clientConfig} organism={organism} accessToken={accessToken} client:load /> | ||
</BaseLayout> | ||
) : ( | ||
<BaseLayout title='Current submissions'> | ||
<NeedToLogin /> | ||
</BaseLayout> | ||
) | ||
} |
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