Skip to content

Commit

Permalink
Add extra verification to check if the email of the application is un…
Browse files Browse the repository at this point in the history
…ique before it is validated
  • Loading branch information
FranciscoCardoso913 committed Sep 16, 2023
2 parents 5c47e2f + 0be0cf9 commit 5d65bf9
Show file tree
Hide file tree
Showing 12 changed files with 6,642 additions and 10,183 deletions.
1 change: 1 addition & 0 deletions documentation/docs/applications/approve.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ values={[

</TabItem>
</Tabs>

### Example 5 - Application is not verified

**Code** : <Highlight level="danger" inline>409 CONFLICT</Highlight>
Expand Down
12 changes: 8 additions & 4 deletions documentation/docs/applications/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Highlight from "../../src/highlight.js"
## Details

This endpoint is used to create company applications.
In order of a Company to use its account, the company must verify its application by clicking in a link sent by email after the creation of the application and then the Company should
finish its registration.
In order for a Company to use its account, the company must verify its application by clicking in a link sent
by email after its creation. After that the Company should finish its registration.

**URL** : `/apply/company`

Expand All @@ -36,7 +36,11 @@ see [register](../auth/register).
Email used for the company application and subsequent account.

Must be in a valid email format.
Can't already be in use for accounts or other applications.
Can't already be in use on any account.

:::info
After creating an application, if another application is created with the same email after 10 minutes, the existing one will be replaced. Creating the new application before the 10 minute mark will result in an error.
:::

### password

Expand Down Expand Up @@ -181,7 +185,7 @@ values={[
"password": "password123",
"companyName": "Company",
"motivation": "We wish to revolutionize the industry with young engineers."
}
}ara quem usa o timetable-bruteforcer
```

</TabItem>
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/applications/reject.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ values={[

</TabItem>
</Tabs>

### Example 5 - Application is not verified

**Code** : <Highlight level="danger" inline>409 CONFLICT</Highlight>
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/applications/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ values={[
"submittedAt": "2022-09-07T13:15:15.971Z",
"isVerified": false,
"__v": 0,
"state": "PENDING"
"state": "UNVERIFIED"
}
],
"docCount": 4
Expand Down
38 changes: 37 additions & 1 deletion documentation/docs/applications/validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ values={[

```bash
/apply/company/invalid/validate

```

</TabItem>
Expand Down Expand Up @@ -159,3 +158,40 @@ values={[

</TabItem>
</Tabs>

### Example 5 - Existing Account with the same email

**Code** : <Highlight level="danger" inline>409 CONFLICT</Highlight>

<Tabs
defaultValue="request"
values={[
{label: 'Request', value: 'request'},
{label: 'Response', value: 'response'},
]}
>
<TabItem value="request">

```bash
/apply/company/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im5pQGFlZmV1cC5wdCIsImlhdCI6MTY2MzAxMzg0OSwiZXhwIjoxNjYzMDE0NDQ5fQ.k5Z_nBpqt_Hs8JBhLH0ZXTl2-BG-utdIAUdhKXEFuFc/validate
```

</TabItem>

<TabItem value="response">

```json
{
"error_code": 3,
"errors": [
{
"msg": "account-already-using-email"
}
]
}
```

</TabItem>
</Tabs>

4 changes: 2 additions & 2 deletions documentation/docs/companies/get-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ values={[

### Example 2 - Insufficient permission

**Code** : <Highlight level="success" inline>401 UNAUTHORIZED</Highlight>
**Code** : <Highlight level="danger" inline>401 UNAUTHORIZED</Highlight>

<Tabs
defaultValue="request"
Expand Down Expand Up @@ -113,7 +113,7 @@ values={[

### Example 3 - Invalid ID

**Code** : <Highlight level="success" inline>422 UNPROCESSABLE ENTITY</Highlight>
**Code** : <Highlight level="danger" inline>422 UNPROCESSABLE ENTITY</Highlight>

<Tabs
defaultValue="request"
Expand Down
Loading

0 comments on commit 5d65bf9

Please sign in to comment.