Commit Graph

60 Commits

Author SHA1 Message Date
Sasha
197e3bc010 docs: corrects old imports (#8769)
1
`import type { Field } from 'payload/types'`
to
`import type { Field } from 'payload'`
2
`import { buildConfig } from 'payload/config'`
to
`import { buildConfig } from 'payload'`

3
```
import { SelectInput, useField } from 'payload/components/forms';
import { useAuth } from 'payload/components/utilities';
```
to
`import { SelectInput, useAuth, useField } from '@payloadcms/ui'`

4
uses `import type` for `import type { CollectionConfig } from 'payload'`
2024-10-18 10:47:47 +03:00
Said Akhrarov
c91f21bb78 docs: fix incorrect link for outside-nextjs in local-api importing it section (#8764)
Currently in the `beta` docs at the bottom of [Local API Overview Import
It
section](https://payloadcms.com/docs/beta/local-api/overview#importing-it)
there is a link for _Outside Nextjs_ which incorrectly sends you to
`/docs/beta/beta/local-api/outside-nextjs` instead of
`docs/beta/local-api/outside-nextjs`.

Interestingly enough, a `Not Found` component/message is not rendered
and instead you see a blank screen.

---------

Co-authored-by: Sasha <64744993+r1tsuu@users.noreply.github.com>
2024-10-17 13:13:37 -06:00
Paul
7b907a8701 chore: add best practices for authenticating with cookies cross domains in documentation (#8301) 2024-09-18 21:08:34 -06:00
Paul
e80da7cb75 chore: add jsdocs for authentication types and add missing config to docs (#8082) 2024-09-06 00:04:13 +00:00
Alessio Gravili
a7b0f8ba36 feat!: new server-only, faster and immediate autoLogin (#7224)
- When autoLogin is enabled, it will no longer flash an unresponsive
"login" screen. Instead, it will straight up open the admin panel.
That's because, on the server, we will now always & immediately see the
user as authenticated, thus no initial login view is pushed to the
client until the client component sends the auth request anymore. Less
useless requests. Additionally, jwt verification is now completely
skipped
- No more auto-login related frontend code. autoLogin handling has been
removed from the frontend `Auth` component
- less code to maintain, this is way simpler now

**For reviewers:**
- The new logic for autoFill without prefillOnly is here: [jwt auth
strategy](https://github.com/payloadcms/payload/pull/7224/files#diff-7d40839079a8b2abb58233e5904513ab321023a70538229dfaf1dfee067dc8bfR21)
- The new logic for autoFill with prefillOnly is here: [Server Login
View](https://github.com/payloadcms/payload/pull/7224/files#diff-683770104f196196743398a698fbf8987f00e4426ca1c0ace3658d18ab80e82dL72)
=> [Client Login
Form](https://github.com/payloadcms/payload/pull/7224/files#diff-ac3504d3b3b0489455245663649bef9e84477bf0c1185da5a4d3a612450f01eeL20)

**BREAKING**
`autoLogin` without `prefillOnly` set now also affects graphQL/Rest
operations. Only the user specified in `autoLogin` will be returned.
Within the graphQL/Rest/Local API, this should still allow you to
authenticate with a different user, as the autoLogin user is only used
if no token is set.
2024-07-20 23:25:50 +00:00
Jarrod Flesch
7b3b02198c feat: ability to login with email, username or both (#7086)
`auth.loginWithUsername`:

```ts
auth: {
  loginWithUsername: {
    allowEmailLogin: true, // default: false
    requireEmail: false, // default: false
  }
}
```

#### `allowEmailLogin`
This property will allow you to determine if users should be able to
login with either email or username. If set to `false`, the default
value, then users will only be able to login with usernames when using
the `loginWithUsername` property.

#### `requireEmail`
Require that users also provide emails when using usernames.
2024-07-18 10:29:44 -04:00
Jacob Fletcher
edb501349f docs: improves authentication docs (#7195) 2024-07-17 12:52:41 -04:00
Jacob Fletcher
0e673c6335 docs: improves access control docs (#7154) 2024-07-15 15:29:11 -04:00
Jacob Fletcher
e9adeecc7a docs: more misc improvements (#7115) 2024-07-11 14:55:13 -04:00
Jacob Fletcher
a1bb661a1a docs: misc improvements (#7107) 2024-07-11 09:54:21 -04:00
Jacob Fletcher
5a76d6db8b docs: improves configuration docs (#7090) 2024-07-09 18:10:04 -04:00
James Mikrut
2daefb2a81 chore: removes unused token arg to refresh operation (#6977)
## Description

Duplicate of #6976 for 3.x
2024-06-28 11:20:49 -04:00
James Mikrut
37e2da012b feat(next)!: allows auth strategies to return headers that need to be… (#6964)
## Description

Some authentication strategies may need to set headers for responses,
such as updating cookies via a refresh token, and similar. This PR
extends Payload's auth strategy capabilities with a manner of
accomplishing this.

This is a breaking change if you have custom authentication strategies
in Payload's 3.0 beta. But it's a simple one to update.

Instead of your custom auth strategy returning the `user`, now you must
return an object with a `user` property.

This is because you can now also optionally return `responseHeaders`,
which will be returned by Payload API responses if you define them in
your auth strategies. This can be helpful for cases where you need to
set cookies and similar, directly within your auth strategies.

Before: 

```ts
return user
```

After:

```ts
return { user }
```
2024-06-27 21:33:25 +00:00
Frederic Perron
8c2779c02a Docs: Change reference to v2 PassportJS docs to utilize new custom strategies docs. (#6961)
## Description

<!-- Please include a summary of the pull request and any related issues
it fixes. Please also include relevant motivation and context. -->

The v3 documentation mislead people by using PassportJS even though it's
not in v3 and custom strategies should be used instead with the correct
link.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] Chore (non-breaking change which does not add functionality)
- [x] This change requires a documentation update

## Checklist:
- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-06-27 11:33:44 -04:00
Jarrod Flesch
39868426b6 chore: updated 3.0 auth docs (#6861) 2024-06-21 15:34:25 -04:00
Jacob Fletcher
a20cf70105 docs: removes express 2024-05-13 10:29:59 -04:00
Alessio Gravili
19f8cbcf76 docs: new and improve lexical docs, hoist up all headings (#6639) 2024-06-05 17:08:15 -04:00
Alessio Gravili
6789e61488 chore: run lint & prettier on everything 2024-03-14 23:53:47 -04:00
Jacob Fletcher
f83d65e0cf docs: fixes mdx syntax error in auth config 2023-12-14 13:33:45 -05:00
Jessica Chowdhury
77ebba3ccd docs: adds api key disclaimer (#4390) 2023-12-12 11:27:12 -05:00
Travis Mcgeehan
c1eb9d1727 feat: support OAuth 2.0 format Authorization: Bearer tokens in headers 2023-11-28 16:23:18 -05:00
Elliot DeNolf
bdbfc8c9af docs: remove mongoURL mentions 2023-10-08 22:26:40 -04:00
Jarrod Flesch
6a74173789 chore: merges existing docs with 2.0 docs (#3450) 2023-10-06 13:33:24 -04:00
Alessio Gravili
ae7d6f97d2 chore: formatting and linting (#3261)
* chore: lint packages/payload

* chore: lint packages/db-postgres

* chore: lint packages/db-mongodb

* chore: update eslintrc exclusion rules

* chore: update eslintrc exclusion rules

* chore: lint misc files

* chore: run prettier through packages

* chore: run eslint on payload again

* chore: prettier misc files

* chore: prettier docs
2023-09-01 17:39:44 +02:00
Dan Ribbens
c6e0908076 feat: recursive saveToJWT field support (#3130) 2023-08-08 12:38:44 -04:00
Alessio Gravili
c5756ed4a1 feat: option to pre-fill login credentials automatically (#3021)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-08-04 13:41:08 -04:00
Dan Ribbens
356f174b9f feat: set JWT token field name with saveToJWT (#3126) 2023-08-04 13:22:05 -04:00
Jessica Chowdhury
7927dd485a docs: adds auth example for useAPIKey and disableLocalStrategy (#3007) 2023-07-17 09:30:30 -04:00
Jessica Boezwinkle
562cd18622 docs: adds authentication video 2023-07-07 17:05:35 +01:00
PatrikKozak
5de3515fc8 chore: re-words portion of api key docs 2023-06-22 10:43:53 -04:00
PatrikKozak
e834424a4c Merge branch 'master' of https://github.com/payloadcms/payload into chore/api-keys-docs 2023-06-13 12:25:09 -04:00
PatrikKozak
465d8b0245 chore: updates authentication/api-keys docs 2023-06-13 12:25:02 -04:00
Jessica Boezwinkle
25e9c1a50a fix: adds async await to payload.init example 2023-06-13 17:02:35 +01:00
Harrison-Blair
13179a9498 chore: misc documentation updates (#2589)
* chore: ensures example configs are being exported when necessary
* chore: adds note regarding updating of hidden fields

---------

Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
2023-05-01 16:28:13 -04:00
Jacob Fletcher
959567aade docs: middleware order #2327 (#2351) 2023-03-20 09:47:57 -04:00
Jacob Fletcher
caee0c07d7 docs: gql me query (#1949) 2023-01-27 10:15:53 -05:00
James
047efe02ff chore: revert #1794 for now until permanent init architecture is established 2023-01-11 09:32:44 -05:00
Christian Schurr
82961767e3 feat!: enforces payload.init is async
* Run connectMongoose before starting payload init

* - reverted changes
- added deprecated to init
- docs: changed all payload.init to payload.initAsync
- changed all internal init calls

* forgotten inits in docs

* reverted back - removed init and renamed initAsync to init
2023-01-09 11:24:22 -05:00
Dan Ribbens
5b70ebd119 fix: use the slug for authentication header API Key
BREAKING CHANGE: replaced the useAPIKey authentication header format to use the collection slug instead of the collection label. Previous: `${collection.labels.singular} API-Key ${apiKey}`, updated: `${collection.slug} API-Key ${apiKey}`
2022-12-19 11:02:40 -05:00
Jarrod Flesch
eda6f70acb Roadmap/#1379 admin ui doc level access (#1624)
* feat: adds document level access endpoints so admin ui can now accurately reflect document level access control
* chore(docs): new doc access callout, updates useDocumentInfo props from change
2022-12-14 16:14:29 -05:00
Ed
5673b709ec docs: make it clear that lockTime is defined in ms (#1459) 2022-11-20 12:50:03 -05:00
James
183cd9a0be chore: updates docs to reflect new website public images folder 2022-11-13 17:41:39 -05:00
Elliot DeNolf
2255ebb64a feat: revert enforce kebab-case slugs (#1322) (#1325) 2022-10-31 16:10:11 -04:00
Elliot DeNolf
0420b6dc27 feat: enforce kebab-case slugs (#1322) 2022-10-31 11:11:00 -04:00
Elliot DeNolf
debcb003bb docs: clarify api key auth usage 2022-10-03 08:41:23 -04:00
Dustin Miller
afa03789b8 docs: Correct “autheticate” misspelling in docs (#1048) 2022-09-02 15:27:06 -04:00
Elliot DeNolf
1ed867ce0c docs: update examples with ts types 2022-08-23 11:43:24 -04:00
James
e1c35b5220 chore: further documents strategies 2022-07-21 16:42:40 -07:00
James
079623f40a fix: responsive improvements to rich text upload 2022-07-18 12:50:20 -07:00
Ahmet Kilinc
b80006be45 Change "ist" to "it" (#668)
docs: Small typo on middleware page
2022-06-20 10:45:34 -04:00