Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit b764734

Browse files
committed
docs(authentication): methods description
1 parent 46f8602 commit b764734

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ const strapi = new Strapi('http://localhost:1337');
3535
## API
3636

3737
### `Strapi(baseURL, requestConfig)`
38+
### `request(method, url, requestConfig)`
3839
### `register(username, email, password)`
3940
### `login(identifier, password)`
4041
### `forgotPassword(email, url)`
4142
### `resetPassword(code, password, passwordConfirmation)`
43+
### `getProviderAuthenticationUrl(provider)`
44+
### `authenticateProvider(provider, params)`
4245
### `setToken(token)`
43-
### `request(method, url, requestConfig)`
4446
### `getEntries(contentType, params)`
4547
### `getEntry(contentType, id)`
4648
### `createEntry(contentType, data)`

src/lib/sdk.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,19 @@ export default class Strapi {
144144
});
145145
}
146146

147+
/**
148+
* Retrieve the connect provider URL
149+
* @param provider
150+
*/
147151
public getProviderAuthenticationUrl(provider: Provider): string {
148152
return `${this.axios.defaults.baseURL}/connect/${provider}`;
149153
}
150154

155+
/**
156+
* Authenticate the user with the token present on the URL (for browser) or in `params` (on Node.js)
157+
* @param provider
158+
* @param params
159+
*/
151160
public async authenticateProvider(
152161
provider: Provider,
153162
params?: Token

0 commit comments

Comments
 (0)