-
Notifications
You must be signed in to change notification settings - Fork 7
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 #19 from ciatph/dev
v1.0.4
- Loading branch information
Showing
7 changed files
with
66 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const styles = { | ||
message: { | ||
overflowWrap: 'break-word' | ||
} | ||
} | ||
|
||
export default styles |
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,7 +1,32 @@ | ||
function Home () { | ||
import PropTypes from 'prop-types' | ||
import Card from '@mui/material/Card' | ||
import CardContent from '@mui/material/CardContent' | ||
import AlertMessage from '../../components/common/alert_message' | ||
import styles from './styles' | ||
|
||
function Home (props) { | ||
return ( | ||
<h1>Home</h1> | ||
<div> | ||
<h1>Home</h1> | ||
|
||
{props.currentUser && | ||
<AlertMessage | ||
severity='info' | ||
title='Your Firebase Authorization Token' | ||
/>} | ||
|
||
{props.currentUser && | ||
<Card sx={{ marginTop: '16px' }}> | ||
<CardContent sx={styles.token}> | ||
{props.currentUser.accessToken} | ||
</CardContent> | ||
</Card>} | ||
</div> | ||
) | ||
} | ||
|
||
Home.propTypes = { | ||
currentUser: PropTypes.object | ||
} | ||
|
||
export default Home |
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,8 @@ | ||
const styles = { | ||
token: { | ||
overflowWrap: 'break-word', | ||
fontSize: '12px' | ||
} | ||
} | ||
|
||
export default styles |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const { ACCOUNT_LEVEL } = require('../utils/constants') | ||
|
||
const isSuperAdmin = async (req, res, next) => { | ||
if (req.user.account_level === ACCOUNT_LEVEL.SUPERADMIN) { | ||
next() | ||
} else { | ||
res.status(403).send('Unauthorized. Not a superadmin.') | ||
} | ||
} | ||
|
||
module.exports = isSuperAdmin |
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,8 @@ | ||
const ACCOUNT_LEVEL = { | ||
SUPERADMIN: 1, | ||
ADMIN: 2 | ||
} | ||
|
||
module.exports = { | ||
ACCOUNT_LEVEL | ||
} |