Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroBern committed Jan 27, 2020
1 parent 3b55c02 commit 35e40b0
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 66 deletions.
7 changes: 5 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

## v0.2


### v0.2.8
- return new token and refreshToken on password change.


### v0.2.7
- allow login on register, returning token and refresh token.


### v0.2.6
- review error fields in some mutations.


### v0.2.5
- update apps config.
- nothing new.
Expand All @@ -30,7 +34,6 @@
- nothing new.



### v0.2.1
- fix readme on pypi.
- nothing new.
Expand All @@ -43,8 +46,8 @@
- allow login with secondary email.


## v0.1

## v0.1

### 0.1.11
- Fix minor bugs.
Expand Down
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ from graphql_auth.schema import UserQuery

The easiest way to explore it is using the [graphiQL](https://docs.graphene-python.org/projects/django/en/latest/tutorial-plain/#creating-graphql-and-graphiql-views).

Examples from the [quickstart](/quickstart):
Examples from the [quickstart](quickstart.md):

```tab="query1"
query {
Expand Down Expand Up @@ -229,7 +229,7 @@ mutation {

### Public

Public mutations don't require user to be logged in. You should add all of them in `#!python GRAPHQL_JWT["JWT_ALLOW_ANY_CLASSES"]` setting, check [how it looks like](/installation/#2-allow-any-classes).
Public mutations don't require user to be logged in. You should add all of them in `#!python GRAPHQL_JWT["JWT_ALLOW_ANY_CLASSES"]` setting, check [how it looks like](installation.md/#2-allow-any-classes).

---

Expand Down Expand Up @@ -1143,7 +1143,7 @@ If you send a request **without** the http Authorization header, or a **bad toke
- If using `graphql_jwt.backends.JSONWebTokenBackend`, it will raise.
- If using `graphql_auth.backends.GraphQLAuthBackend`, it will return a standard response, with `success=False` and `errors`.

As explained on the [installation guide](/installation/#5-authentication-backend-optional)
As explained on the [installation guide](installation.md/#5-authentication-backend-optional)

---

Expand Down
7 changes: 5 additions & 2 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

## v0.2


### v0.2.8
- return new token and refreshToken on password change.


### v0.2.7
- allow login on register, returning token and refresh token.


### v0.2.6
- review error fields in some mutations.


### v0.2.5
- update apps config.
- nothing new.
Expand All @@ -30,7 +34,6 @@
- nothing new.



### v0.2.1
- fix readme on pypi.
- nothing new.
Expand All @@ -43,8 +46,8 @@
- allow login with secondary email.


## v0.1

## v0.1

### 0.1.11
- Fix minor bugs.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ u.status.verified
# True
```

Check the [installation guide](/installation) or jump to the [quickstart](/quickstart). Or if you prefer, browse the [api](/api).
Check the [installation guide](installation.md) or jump to the [quickstart](quickstart.md). Or if you prefer, browse the [api](api.md).
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ python manage.py migrate
### 5. Email Templates

!!! Note ""
Overriding email templates is covered [here](/overriding-email-templates).
Overriding email templates is covered [here](overriding-email-templates.md).

This package comes with some default email templates, if you plan to use it, make sure your templates configuration has the following:

Expand All @@ -267,7 +267,7 @@ TEMPLATES = [
### 6. Email Backend

The default configuration is to send activation email,
you can set it to ``False`` on your [settings](/settings),
you can set it to ``False`` on your [settings](settings.md),
but you still need an Email Backend
to password reset.

Expand Down
4 changes: 2 additions & 2 deletions docs/overriding-email-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Create the following folder and files structure:
manage.py
```

This is the minimum. Check the [email templates settings](/settings/#email-templates), you can create custom templates for:
This is the minimum. Check the [email templates settings](settings.md/#email-templates), you can create custom templates for:

- account activation
- resend account activation email
Expand All @@ -53,7 +53,7 @@ Both subject and email templates receive the following variables:
- site_name --> from [django sites framework](https://docs.djangoproject.com/en/3.0/ref/contrib/sites/) <small>(optional)</small>
- domain --> from [django sites framework](https://docs.djangoproject.com/en/3.0/ref/contrib/sites/) <small>(optional)</small>
- protocol
- path --> defined in [settings](/settings) <small>(some frontend path)</small>
- path --> defined in [settings](settings.md) <small>(some frontend path)</small>


## Writing the templates
Expand Down
14 changes: 7 additions & 7 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ corner under docs tab.
## Setup Email Backend

The default configuration is to send activation email when registring users,
you can set it to ``False`` on your [settings](/settings),
you can set it to ``False`` on your [settings](settings.md),
but you still need an Email Backend
to password reset.

Expand Down Expand Up @@ -698,7 +698,7 @@ query {
}
```

There is actually a new user and it is possible to log in (you can change it on the [settings](/settings)),
There is actually a new user and it is possible to log in (you can change it on the [settings](settings.md)),
but it is not verified yet.

Save the ``id`` of the new user, so we can query it later.
Expand Down Expand Up @@ -1043,12 +1043,12 @@ query {

## Next steps

- Add [all mutations](/quickstart/#full-schema) to your schema!
- Add [all mutations](quickstart.md/#full-schema) to your schema!
- Navigate through the GraphiQL Documentation Explorer.
- Change the [settings](/settings).
- Explore the [api](/api).
- [Override email templates](/overriding-email-templates).
- Explore [these useful links](/community).
- Change the [settings](settings.md).
- Explore the [api](api.md).
- [Override email templates](overriding-email-templates.md).
- Explore [these useful links](community.md).

### Full schema

Expand Down
88 changes: 41 additions & 47 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,39 @@ GRAPHQL_AUTH = {

---

## Boolean Flags


### ALLOW_LOGIN_NOT_VERIFIED

Determines whether the user can log in without being verified. If it is true, the registring returns `token` and `refresh token` on the output.

default: `#!python True`

### ALLOW_LOGIN_WITH_SECONDARY_EMAIL

If a user has a secondary email set, he can use to login.

default: `#!python True`

### ALLOW_DELETE_ACCOUNT

Instead of deleting the account, make `#!python user.is_active=False`.

If set to `#!python True`, will actually delete the account.

default: `#!python False`

### SEND_ACTIVATION_EMAIL

If set to `#!python False`, no email will be sent.

Note that users will still have an `#!python verified=False` status.

default: `#!python True`

---

## Dynamic Fields

Fields that you can choose.
Expand Down Expand Up @@ -53,54 +86,23 @@ REGISTER_MUTATION_FIELDS = {

default: `#!python ["email", "username"]`

### ALLOW_LOGIN_WITH_SECONDARY_EMAIL

If a user has a secondary email set, he can use to login.

default: `#!python True`

### REGISTER_MUTATION_FIELDS

Required fields on registration, along with `password1` and `password2`.

default: `#!python ["email", "username"]` [\*](/settings/#basics)
default: `#!python ["email", "username"]` [\*](settings.md/#basics)

### REGISTER_MUTATION_FIELDS_OPTIONAL

Optional fields on registration.

default: `#!python []` [\*](/settings/#basics)
default: `#!python []` [\*](settings.md/#basics)

### UPDATE_MUTATION_FIELDS

Optional fields on update account.

default: `#!python ["first_name", "last_name"]` [\*](/settings/#basics)


---

## Other

### ALLOW_LOGIN_NOT_VERIFIED

Determines whether the user can log in without being verified. If it is true, the registring returns `token` and `refresh token` on the output.

default: `#!python True`

### ALLOW_LOGIN_WITH_SECONDARY_EMAIL

If a user has a secondary email set, he can use to login.

default: `#!python True`

### ALLOW_DELETE_ACCOUNT

Instead of deleting the account, make `#!python user.is_active=False`.

If set to `#!python True`, will actually delete the account.

default: `#!python False`
default: `#!python ["first_name", "last_name"]` [\*](settings.md/#basics)

---

Expand Down Expand Up @@ -146,14 +148,6 @@ default: `#!python timedelta(hours=1)`

## Email

### SEND_ACTIVATION_EMAIL

If set to `#!python False`, no email will be sent.

Note that users will still have an `#!python verified=False` status.

default: `#!python True`

### EMAIL_FROM

It will get the default value from your settings, but you can provide a specific email.
Expand All @@ -162,27 +156,27 @@ default: `#!python getattr(django_settings, "DEFAULT_FROM_EMAIL", "test@email.co

### ACTIVATION_PATH_ON_EMAIL

Path [variable](/overriding-email-templates/#email-variables) used in activation email.
Path [variable](overriding-email-templates.md/#email-variables) used in activation email.

default: `#!python "activate"`

### PASSWORD_RESET_PATH_ON_EMAIL

Path [variable](/overriding-email-templates/#email-variables) used in password reset email.
Path [variable](overriding-email-templates.md/#email-variables) used in password reset email.

default: `#!python "password-reset"`

### ACTIVATION_SECONDARY_EMAIL_PATH_ON_EMAIL

Path [variable](/overriding-email-templates/#email-variables) used in secondary email activation email.
Path [variable](overriding-email-templates.md/#email-variables) used in secondary email activation email.

default: `#!python "activate"`

---

## Email subject templates

You can override email templates as shown [here](/overriding-email-templates), but you can also change the templates names.
You can override email templates as shown [here](overriding-email-templates.md), but you can also change the templates names.

### EMAIL_SUBJECT_ACTIVATION

Expand All @@ -205,7 +199,7 @@ default: `#!python "email/password_reset_subject.txt"`

## Email templates

You can override email templates as shown [here](/overriding-email-templates), but you can also change the templates names.
You can override email templates as shown [here](overriding-email-templates.md), but you can also change the templates names.


### EMAIL_TEMPLATE_ACTIVATION
Expand Down

0 comments on commit 35e40b0

Please sign in to comment.