Skip to content

Commit

Permalink
Merge pull request #31 from /issues/30
Browse files Browse the repository at this point in the history
Issues/30
  • Loading branch information
nasubi-dev authored Jun 15, 2024
2 parents 9a96778 + 9ef53fd commit 0040f10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/pages/auth/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { Flex, Text } from "@radix-ui/themes";
import { type ReactElement } from "react";

export default function Page(): ReactElement {
const params = new URLSearchParams(window.location.search);
console.log(params);
const url = new URLSearchParams(window.location.search);
const code = url.get("code");
console.log(code);
return (
<Flex direction="column" gap="2">
<Text>こちらCallbackになります</Text>

<Text>code: {code}</Text>
</Flex>
);
}
7 changes: 6 additions & 1 deletion src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ export default function Page(): ReactElement {
<Flex direction="column" gap="2">
<Text>こちらログイン画面になります</Text>
<a
href={`https://api.esa.io/oauth/authorize?client_id=${import.meta.env.VITE_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_REDIRECT_LOCAL_URI}&scope=read+write&response_type=code`}
href={`https://api.esa.io/oauth/authorize?client_id=${import.meta.env.VITE_LOCAL_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_LOCAL_REDIRECT_URI}&scope=read+write&response_type=code`}
>
<Button>Local Login</Button>
</a>
<a
href={`https://api.esa.io/oauth/authorize?client_id=${import.meta.env.VITE_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_REDIRECT_URI}&scope=read+write&response_type=code`}
>
<Button>Login</Button>
</a>
Expand Down

0 comments on commit 0040f10

Please sign in to comment.