-
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.
Merge pull request #6 from FuelLabs/sophie/api-tokens
feat: manage user API tokens
- Loading branch information
Showing
37 changed files
with
1,281 additions
and
263 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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
# Server env | ||
POSTGRES_USER="postgres" | ||
POSTGRES_PASSWORD="localpw" | ||
POSTGRES_URI="localhost" | ||
POSTGRES_PORT="5432" | ||
POSTGRES_DB_NAME="forc_pub" | ||
POSTGRES_DB_NAME="forc_pub" | ||
|
||
# Local env | ||
CORS_HTTP_ORIGIN="http://localhost:3000" | ||
|
||
# Diesel CLI env | ||
DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_URI}/${POSTGRES_DB_NAME}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,43 @@ | ||
import React from 'react'; | ||
import IconButton from '@mui/material/IconButton'; | ||
import ContentCopyIcon from '@mui/icons-material/ContentCopy'; | ||
|
||
export interface CopyableProps { | ||
token: string; | ||
} | ||
|
||
async function handleCopy(value: string) { | ||
await navigator.clipboard.writeText(value); | ||
} | ||
|
||
function CopyableToken({ token }: CopyableProps) { | ||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
fontSize: '16px', | ||
background: '#383838', | ||
color: 'white', | ||
borderRadius: '4px', | ||
textAlign: 'left', | ||
position: 'relative', | ||
}}> | ||
<div | ||
style={{ | ||
flex: '1 1 auto', | ||
overflow: 'auto', | ||
padding: '0 1rem', | ||
}}> | ||
<pre>{token}</pre> | ||
</div> | ||
<div style={{ flex: '0 0 auto', margin: '5px 5px 0 0' }}> | ||
<IconButton onClick={() => handleCopy(token)} aria-label='copy'> | ||
<ContentCopyIcon style={{ color: 'white' }} /> | ||
</IconButton> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default CopyableToken; |
Oops, something went wrong.