Skip to content

Commit

Permalink
show note about token creation when signed in
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jul 18, 2023
1 parent b45768e commit 8209a85
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions src/components/orgAuthTokenNote.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, {Fragment} from 'react';
import {useLocation} from '@reach/router';
import {graphql, useStaticQuery} from 'gatsby';

Expand All @@ -23,20 +23,27 @@ export function OrgAuthTokenNote() {
const url = data.site.siteMetadata.siteUrl + location.pathname;

return (
<SignedInCheck isUserAuthenticated={false}>
<Note>
{' '}
You can{' '}
<ExternalLink href="https://sentry.io/settings/auth-tokens/" target="_blank">
manually create an Auth Token
</ExternalLink>{' '}
or{' '}
<ExternalLink href={`https://sentry.io/auth/login/?next=${url}`}>
sign in
</ExternalLink>{' '}
to create a token directly from the docs.
</Note>
);
</SignedInCheck>
<Fragment>
<SignedInCheck isUserAuthenticated={false}>
<Note>
You can{' '}
<ExternalLink href="https://sentry.io/settings/auth-tokens/" target="_blank">
manually create an Auth Token
</ExternalLink>{' '}
or{' '}
<ExternalLink href={`https://sentry.io/auth/login/?next=${url}`}>
sign in
</ExternalLink>{' '}
to create a token directly from the docs.
</Note>
</SignedInCheck>

<SignedInCheck isUserAuthenticated>
<Note>
A created token will only be visible once right after creation - make sure to
copy it!
</Note>
</SignedInCheck>
</Fragment>
);
}

0 comments on commit 8209a85

Please sign in to comment.