-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
390 additions
and
10 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
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,20 @@ | ||
import { Box, Link } from '@cloudscape-design/components'; | ||
import React from 'react'; | ||
import { Copy } from '../common/copy'; | ||
import { KeyValuePairs, ValueWithLabel } from '../common/key-value-pairs'; | ||
|
||
export function Contact() { | ||
return ( | ||
<KeyValuePairs columns={3}> | ||
<ValueWithLabel label={'Ingame'}> | ||
<Copy copyText={'Felix.9127'}>Felix.9127</Copy> | ||
</ValueWithLabel> | ||
<ValueWithLabel label={'Discord'}> | ||
<Box>Join the <Link href={'https://discord.gg/9BpnA7sh'} external={true}>GW2 Development Community</Link> in channel <Box variant={'strong'}>#gw2auth</Box></Box> | ||
</ValueWithLabel> | ||
<ValueWithLabel label={'E-Mail'}> | ||
<Box>Send us an E-Mail at <Copy copyText={'[email protected]'}><Link href={'mailto:[email protected]'} external={true}>[email protected]</Link></Copy></Box> | ||
</ValueWithLabel> | ||
</KeyValuePairs> | ||
); | ||
} |
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
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,11 +1,97 @@ | ||
import { Container, ContentLayout, Header } from '@cloudscape-design/components'; | ||
import React from 'react'; | ||
import { | ||
Box, | ||
Container, ContentLayout, Header, Link, Spinner, | ||
} from '@cloudscape-design/components'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { KeyValuePairs, ValueWithLabel } from '../components/common/key-value-pairs'; | ||
import { RouterLink } from '../components/common/router-link'; | ||
import { Contact } from '../components/contact/contact'; | ||
import { useAuthInfo } from '../components/util/context/auth-info'; | ||
import { useHttpClient } from '../components/util/context/http-client'; | ||
import { expectSuccess } from '../lib/api/api'; | ||
import { ApplicationSummary } from '../lib/api/api.model'; | ||
|
||
export default function Home() { | ||
const { apiClient } = useHttpClient(); | ||
const [authInfo] = useAuthInfo(); | ||
|
||
const [summary, setSummary] = useState<ApplicationSummary>(); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
const { body } = expectSuccess(await apiClient.getApplicationSummary()); | ||
setSummary(body); | ||
})() | ||
.finally(() => {}); | ||
}, [apiClient]); | ||
|
||
return ( | ||
<ContentLayout header={<Header variant={'h1'}>Welcome to GW2Auth!</Header>}> | ||
<Container> | ||
<Container variant={'stacked'} header={<Header variant={'h2'}>As a user ...</Header>}> | ||
<Box variant={'h5'}>Your portal to manage access shared with applications using the Guild Wars 2 API</Box> | ||
<Box variant={'p'}>One API Token to rule them all.</Box> | ||
<Box variant={'p'}> | ||
We have observed that many users tend to create only a single API Token and pass this to every application out there. | ||
This is convenient, since you only have to keep this single API Token and don't need to login to the Guild Wars 2 website everytime you want to use a new application. | ||
</Box> | ||
<Box variant={'p'}> | ||
Even though this is convenient, this leads to a mess where you never know which applications keep reading your Guild Wars 2 data. | ||
An API Token is valid until it is deleted - if only a single API Token is used for every application, you have no way to revoke the access only for a single application. | ||
</Box> | ||
<Box variant={'p'}> | ||
GW2Auth allows you to add only a single API Token for each of your Guild Wars 2 accounts and manages each applications access for you. | ||
You can revoke the access of a single application at any point in time through GW2Auth. | ||
</Box> | ||
<Box margin={{ top: 's' }} variant={'small'}> | ||
GW2Auth uses <Link href={'https://wiki.guildwars2.com/wiki/API:2/createsubtoken'} external={true} fontSize={'inherit'}>subtokens</Link> to restrict the permissions granted to an application. | ||
</Box> | ||
</Container> | ||
|
||
<Container variant={'stacked'} header={<Header variant={'h2'}>As a developer ...</Header>}> | ||
<Box variant={'h5'}>Multiple accounts? Account verification? Simple login? GW2Auth has your back</Box> | ||
<Box variant={'p'}> | ||
Creating an application that consumes API Tokens is easy at first, but as your application evolves, you might want to support more than that. | ||
GW2Auth supports multiple Guild Wars 2 Accounts for a single user out of the box. | ||
It also provides you with a unique user ID which can be used to create a unique user account on your side to enrich it with more data like personalized settings etc. | ||
</Box> | ||
<Box variant={'p'}> | ||
You may also request to read the verification status of a users Guild Wars 2 Accounts to ensure a user is the legitimate owner of a Guild Wars 2 Account. | ||
</Box> | ||
<Box margin={{ top: 's', bottom: 'm' }} variant={'small'}> | ||
Check out the <Link href={'https://github.com/gw2auth/oauth2-server/wiki/GW2Auth-Developer-Guide'} external={true} fontSize={'inherit'}>Developer Wiki</Link> to learn more. | ||
</Box> | ||
|
||
<Box variant={'h5'}>Get started now!</Box> | ||
<Box variant={'p'}> | ||
{authInfo | ||
? (<Box>Create your first application on the <RouterLink to={'/dev/applications'}>Developer Page</RouterLink> and get started right away.</Box>) | ||
: (<Box>Login or create an account and create your first application.</Box>) | ||
} | ||
</Box> | ||
</Container> | ||
|
||
<Container variant={'stacked'} header={<Header variant={'h2'}>Many users trust GW2Auth</Header>}> | ||
<KeyValuePairs columns={3}> | ||
<LoadableValueWithLabel label={'Accounts'}>{summary?.accounts}</LoadableValueWithLabel> | ||
<LoadableValueWithLabel label={'API Tokens'}>{summary?.gw2ApiTokens}</LoadableValueWithLabel> | ||
<LoadableValueWithLabel label={'Verified GW2 Accounts'}>{summary?.verifiedGw2Accounts}</LoadableValueWithLabel> | ||
<LoadableValueWithLabel label={'Applications'}>{summary?.applications}</LoadableValueWithLabel> | ||
<LoadableValueWithLabel label={'Clients'}>{summary?.applicationClients}</LoadableValueWithLabel> | ||
<LoadableValueWithLabel label={'Authorizations'}>{summary?.applicationClientAccounts}</LoadableValueWithLabel> | ||
</KeyValuePairs> | ||
</Container> | ||
|
||
<Container variant={'stacked'} header={<Header variant={'h2'}>Contact us</Header>}> | ||
<Contact /> | ||
</Container> | ||
</ContentLayout> | ||
); | ||
} | ||
|
||
function LoadableValueWithLabel({ label, children }: React.PropsWithChildren<{ label: string }>) { | ||
return ( | ||
<ValueWithLabel label={label}> | ||
{children === undefined ? <Spinner /> : children} | ||
</ValueWithLabel> | ||
); | ||
} |
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
Oops, something went wrong.