Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added demo feature #12

Merged
merged 7 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { getGoogleAuthUrl, getAppleAuthUrl, getGitHubAuthUrl } from '~/api/auth'
import { setAccessToken } from '~/api/auth/client'

import Button from '~/components/material/Button'
import Typography from '~/components/material/Typography'

export default function Login() {
const loginAsDemoUser = function () {
setAccessToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDg1ODI0NjUsIm5iZiI6MTcxNzA0NjQ2NSwiaWF0IjoxNzE3MDQ2NDY1LCJpZGVudGl0eSI6IjBkZWNkZGNmZGYyNDFhNjAifQ.g3khyJgOkNvZny6Vh579cuQj1HLLGSDeauZbfZri9jw');
window.location.href = window.location.origin;
};

return (
<div class="flex min-h-screen flex-col items-center justify-center bg-background p-6">
<div class="flex max-w-sm flex-col items-center gap-8">
Expand Down Expand Up @@ -90,6 +96,18 @@ export default function Login() {
height={32}
/>
</div>

<Button
class="gap-4"
onclick={loginAsDemoUser}
trailing={
<span class="material-symbols-outlined icon-outline">
chevron_right
</span>
}
>
Try the demo
</Button>
</div>
</div>
)
Expand Down