Skip to content

Commit 21ad399

Browse files
authored
docs: replacing adapter with provider (#165)
1 parent 7d39e76 commit 21ad399

File tree

9 files changed

+12
-381
lines changed

9 files changed

+12
-381
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { GithubProvider } from "@openauthjs/openauth/provider/github"
8282

8383
const app = issuer({
8484
providers: {
85-
github: GithubAdapter({
85+
github: GithubProvider({
8686
clientID: process.env.GITHUB_CLIENT_ID!,
8787
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
8888
scopes: ["user:email"],
@@ -100,13 +100,13 @@ import { PasswordProvider } from "@openauthjs/openauth/provider/password"
100100
const app = issuer({
101101
providers: {
102102
github: ...,
103-
password: PasswordAdapter(...),
103+
password: PasswordProvider(...),
104104
},
105105
...
106106
})
107107
```
108108

109-
The password adapter is quite complicated as username/password involve a lot of flows so there are a lot of callbacks to implement. However you can opt into the default UI which has all of this already implemented for you. The only thing you have to specify is how to send a code for forgot password/email verification. In this case we'll log the code but you would send this over email.
109+
The password provider is quite complicated as username/password involve a lot of flows so there are a lot of callbacks to implement. However you can opt into the default UI which has all of this already implemented for you. The only thing you have to specify is how to send a code for forgot password/email verification. In this case we'll log the code but you would send this over email.
110110

111111
```ts
112112
import { PasswordProvider } from "@openauthjs/openauth/provider/password"
@@ -115,7 +115,7 @@ import { PasswordUI } from "@openauthjs/openauth/ui/password"
115115
const app = issuer({
116116
providers: {
117117
github: ...,
118-
password: PasswordAdapter(
118+
password: PasswordProvider(
119119
PasswordUI({
120120
sendCode: async (email, code) => {
121121
console.log(email, code)

packages/openauth/src/issuer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* const app = issuer({
2828
* providers: {
29-
* github: GithubAdapter({
29+
* github: GithubProvider({
3030
* // ...
3131
* }),
3232
* password: PasswordProvider({

packages/openauth/src/provider/code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* })
2222
* ```
2323
*
24-
* You can customize the adapter using.
24+
* You can customize the provider using.
2525
*
2626
* ```ts {7-9}
2727
* const ui = CodeUI({

www/src/content/docs/docs/adapter/apple.mdx

Lines changed: 0 additions & 178 deletions
This file was deleted.

www/src/content/docs/docs/adapter/google.mdx

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)