Merge branch 'main' into bugfix/zoom-invalid-token

This commit is contained in:
Bailey Pumfleet 2021-06-29 16:19:20 +01:00 committed by GitHub
commit 099186fdd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 16 deletions

View file

@ -155,6 +155,13 @@ You will also need Google API credentials. You can get this from the [Google API
yarn start
```
5. Enjoy the new version.
<!-- DEPLOYMENT -->
## Deployment
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template?template=https%3A%2F%2Fgithub.com%2Fcalendso%2Fcalendso&plugins=postgresql&envs=GOOGLE_API_CREDENTIALS%2CBASE_URL%2CNEXTAUTH_URL%2CPORT&BASE_URLDefault=http%3A%2F%2Flocalhost%3A3000&NEXTAUTH_URLDefault=http%3A%2F%2Flocalhost%3A3000&PORTDefault=3000)
You can deploy Calendso on [Railway](https://railway.app/) using the button above. The team at Railway also have a [detailed blog post](https://blog.railway.app/p/calendso) on deploying Calendso on their platform.
<!-- ROADMAP -->
## Roadmap
@ -239,4 +246,3 @@ Special thanks to these amazing projects which help power Calendso:
* [Prisma](https://prisma.io/)
[product-screenshot]: https://i.imgur.com/4yvFj2E.png

View file

@ -67,7 +67,17 @@ const getLocationRequestFromIntegration = ({ location }: GetLocationRequestFromI
export default async function handler(req: NextApiRequest, res: NextApiResponse): Promise<void> {
const { user } = req.query;
let currentUser = await prisma.user.findFirst({
const isTimeInPast = (time) => {
return dayjs(time).isBefore(new Date(), "day");
};
if (isTimeInPast(req.body.start)) {
return res
.status(400)
.json({ errorCode: "BookingDateInPast", message: "Attempting to create a meeting in the past." });
}
const currentUser = await prisma.user.findFirst({
where: {
username: user,
},

View file

@ -1,4 +1,5 @@
import Head from "next/head";
import Link from "next/link";
import React from "react";
import { getCsrfToken } from "next-auth/client";
import debounce from "lodash.debounce";
@ -137,6 +138,15 @@ export default function Page({ csrfToken }) {
Request Password Reset
</button>
</div>
<div className="space-y-2">
<Link href="/auth/login">
<button
type="button"
className="w-full flex justify-center py-2 px-4 text-sm font-medium text-blue-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
Login
</button>
</Link>
</div>
</form>
</>
)}