Merge branch 'main' into bugfix/zoom-invalid-token
This commit is contained in:
commit
099186fdd9
3 changed files with 42 additions and 16 deletions
36
README.md
36
README.md
|
@ -80,30 +80,30 @@ You will also need Google API credentials. You can get this from the [Google API
|
||||||
```
|
```
|
||||||
<details>
|
<details>
|
||||||
<summary>If you don't know how to configure the DATABASE_URL, then follow the steps here</summary>
|
<summary>If you don't know how to configure the DATABASE_URL, then follow the steps here</summary>
|
||||||
|
|
||||||
1. Create a free account with [Heroku](https://www.heroku.com/).
|
1. Create a free account with [Heroku](https://www.heroku.com/).
|
||||||
|
|
||||||
2. Create a new app.
|
2. Create a new app.
|
||||||
<img width="306" alt="Google Chrome — CleanShotX | 2021-04-20 at 02 01 56" src="https://user-images.githubusercontent.com/16905768/115322780-b3d58c00-a17e-11eb-8a52-b758fb0ea942.png">
|
<img width="306" alt="Google Chrome — CleanShotX | 2021-04-20 at 02 01 56" src="https://user-images.githubusercontent.com/16905768/115322780-b3d58c00-a17e-11eb-8a52-b758fb0ea942.png">
|
||||||
|
|
||||||
3. In your new app, go to `Overview` and next to `Installed add-ons`, click `Configure Add-ons`. We need this to set up our database.
|
3. In your new app, go to `Overview` and next to `Installed add-ons`, click `Configure Add-ons`. We need this to set up our database.
|
||||||

|

|
||||||
|
|
||||||
4. Once you clicked on `Configure Add-ons`, click on `Find more add-ons` and search for `postgres`. One of the options will be `Heroku Postgres` - click on that option.
|
4. Once you clicked on `Configure Add-ons`, click on `Find more add-ons` and search for `postgres`. One of the options will be `Heroku Postgres` - click on that option.
|
||||||

|

|
||||||
|
|
||||||
5. Once the pop-up appears, click `Submit Order Form` - plan name should be `Hobby Dev - Free`.
|
5. Once the pop-up appears, click `Submit Order Form` - plan name should be `Hobby Dev - Free`.
|
||||||
<img width="512" alt="Google Chrome — CleanShotX | 2021-04-20 at 02 04 29" src="https://user-images.githubusercontent.com/16905768/115323265-b4baed80-a17f-11eb-99f0-d67f019aa6df.png">
|
<img width="512" alt="Google Chrome — CleanShotX | 2021-04-20 at 02 04 29" src="https://user-images.githubusercontent.com/16905768/115323265-b4baed80-a17f-11eb-99f0-d67f019aa6df.png">
|
||||||
|
|
||||||
6. Once you completed the above steps, click on your newly created `Heroku Postgres` and go to its `Settings`.
|
6. Once you completed the above steps, click on your newly created `Heroku Postgres` and go to its `Settings`.
|
||||||

|

|
||||||
|
|
||||||
7. In `Settings`, copy your URI to your Calendso .env file and replace the `postgresql://<user>:<pass>@<db-host>:<db-port>` with it.
|
7. In `Settings`, copy your URI to your Calendso .env file and replace the `postgresql://<user>:<pass>@<db-host>:<db-port>` with it.
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
8. To view your DB, once you add new data in Prisma, you can use [Heroku Data Explorer](https://heroku-data-explorer.herokuapp.com/).
|
8. To view your DB, once you add new data in Prisma, you can use [Heroku Data Explorer](https://heroku-data-explorer.herokuapp.com/).
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
5. Set up the database using the Prisma schema (found in `prisma/schema.prisma`)
|
5. Set up the database using the Prisma schema (found in `prisma/schema.prisma`)
|
||||||
```sh
|
```sh
|
||||||
|
@ -127,7 +127,7 @@ You will also need Google API credentials. You can get this from the [Google API
|
||||||
git pull
|
git pull
|
||||||
```
|
```
|
||||||
2. Apply database migrations by running <b>one of</b> the following commands:
|
2. Apply database migrations by running <b>one of</b> the following commands:
|
||||||
|
|
||||||
In a development environment, run:
|
In a development environment, run:
|
||||||
```
|
```
|
||||||
npx prisma migrate dev
|
npx prisma migrate dev
|
||||||
|
@ -140,7 +140,7 @@ You will also need Google API credentials. You can get this from the [Google API
|
||||||
```
|
```
|
||||||
3. Check the `.env.example` and compare it to your current `.env` file. In case there are any fields not present
|
3. Check the `.env.example` and compare it to your current `.env` file. In case there are any fields not present
|
||||||
in your current `.env`, add them there.
|
in your current `.env`, add them there.
|
||||||
|
|
||||||
For the current version, especially check if the variable `BASE_URL` is present and properly set in your environment, for example:
|
For the current version, especially check if the variable `BASE_URL` is present and properly set in your environment, for example:
|
||||||
```
|
```
|
||||||
BASE_URL='https://yourdomain.com'
|
BASE_URL='https://yourdomain.com'
|
||||||
|
@ -155,6 +155,13 @@ You will also need Google API credentials. You can get this from the [Google API
|
||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
5. Enjoy the new version.
|
5. Enjoy the new version.
|
||||||
|
<!-- DEPLOYMENT -->
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
[](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 -->
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
|
@ -239,4 +246,3 @@ Special thanks to these amazing projects which help power Calendso:
|
||||||
* [Prisma](https://prisma.io/)
|
* [Prisma](https://prisma.io/)
|
||||||
|
|
||||||
[product-screenshot]: https://i.imgur.com/4yvFj2E.png
|
[product-screenshot]: https://i.imgur.com/4yvFj2E.png
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,17 @@ const getLocationRequestFromIntegration = ({ location }: GetLocationRequestFromI
|
||||||
export default async function handler(req: NextApiRequest, res: NextApiResponse): Promise<void> {
|
export default async function handler(req: NextApiRequest, res: NextApiResponse): Promise<void> {
|
||||||
const { user } = req.query;
|
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: {
|
where: {
|
||||||
username: user,
|
username: user,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
|
import Link from "next/link";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { getCsrfToken } from "next-auth/client";
|
import { getCsrfToken } from "next-auth/client";
|
||||||
import debounce from "lodash.debounce";
|
import debounce from "lodash.debounce";
|
||||||
|
@ -137,6 +138,15 @@ export default function Page({ csrfToken }) {
|
||||||
Request Password Reset
|
Request Password Reset
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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>
|
</form>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in a new issue