rip out all old auth data

This commit is contained in:
Thomas Ruoff
2021-10-02 01:03:02 +02:00
committed by Thomas Ruoff
parent b257bc8258
commit 0e84945ab4
8 changed files with 22 additions and 89 deletions

View File

@@ -9,32 +9,18 @@ import { getMilageMax } from '../../../../db/index'
import { daysFormatFrontend } from '../../../../helpers/date'
import { getBillTotal, createBill, patchBill } from '../../../../helpers/bill'
import { getBookingStatus } from '../../../../helpers/booking'
import withSession, {
isAdminSession,
redirectToLogin,
} from '../../../../lib/session'
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
export const getServerSideProps = withSession(async (context) => {
const { req, res } = context
const adminUser = isAdminSession(req)
if (!adminUser) {
redirectToLogin(req, res)
return { props: {} }
}
export const getServerSideProps = async (context) => {
const milageMax = await getMilageMax()
const serverSideBookingProps = await getServerSideBooking(context)
return {
props: {
...serverSideBookingProps.props,
milageMax,
user: adminUser,
},
}
})
};
}
const milageTarifOptions = Object.values(MILAGE_TARIFS).map((tarif) => {
return (
@@ -217,9 +203,8 @@ export default function BookingBillPage({
>
-
</button>
<label className="flabel inline">{`Kostenpunkt ${
index + 1
}`}</label>
<label className="flabel inline">{`Kostenpunkt ${index + 1
}`}</label>
</div>
<div className="ml-10 mb-3" key={`input{index}`}>
<Input