Skip to content

Commit 94d1698

Browse files
committed
add @see to all gotrue-js methods
1 parent 91f44a8 commit 94d1698

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/index.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ export function useNetlifyIdentity(
163163
// https://react-netlify-identity.netlify.com/login#access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NTY0ODY3MjEsInN1YiI6ImNiZjY5MTZlLTNlZGYtNGFkNS1iOTYzLTQ4ZTY2NDcyMDkxNyIsImVtYWlsIjoic2hhd250aGUxQGdtYWlsLmNvbSIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImdpdGh1YiJ9LCJ1c2VyX21ldGFkYXRhIjp7ImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRhcnMxLmdpdGh1YnVzZXJjb250ZW50LmNvbS91LzY3NjQ5NTc_dj00IiwiZnVsbF9uYW1lIjoic3d5eCJ9fQ.E8RrnuCcqq-mLi1_Q5WHJ-9THIdQ3ha1mePBKGhudM0&expires_in=3600&refresh_token=OyA_EdRc7WOIVhY7RiRw5w&token_type=bearer
164164
/******* external oauth */
165165

166+
/**
167+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L71
168+
*/
166169
const loginProvider = useCallback(
167170
(provider: Provider) => {
168171
const url = goTrueInstance.loginExternalUrl(provider);
@@ -171,6 +174,9 @@ export function useNetlifyIdentity(
171174
[goTrueInstance]
172175
);
173176

177+
/**
178+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L92
179+
*/
174180
const acceptInviteExternalUrl = useCallback(
175181
(provider: Provider) => {
176182
if (!param.token || param.type !== 'invite') {
@@ -187,6 +193,9 @@ export function useNetlifyIdentity(
187193
);
188194

189195
/******* email auth */
196+
/**
197+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L50
198+
*/
190199
const signupUser = useCallback(
191200
(
192201
email: string,
@@ -204,17 +213,26 @@ export function useNetlifyIdentity(
204213
[goTrueInstance, _setUser]
205214
);
206215

216+
/**
217+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L57
218+
*/
207219
const loginUser = useCallback(
208220
(email: string, password: string, remember: boolean = true) =>
209221
goTrueInstance.login(email, password, remember).then(_setUser),
210222
[goTrueInstance, _setUser]
211223
);
212224

225+
/**
226+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L80
227+
*/
213228
const requestPasswordRecovery = useCallback(
214229
(email: string) => goTrueInstance.requestPasswordRecovery(email),
215230
[goTrueInstance]
216231
);
217232

233+
/**
234+
* @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L87
235+
*/
218236
const recoverAccount = useCallback(
219237
(remember?: boolean) => {
220238
if (!param.token || param.type !== 'recovery') {
@@ -234,6 +252,9 @@ export function useNetlifyIdentity(
234252
[goTrueInstance, _setUser, param]
235253
);
236254

255+
/**
256+
* @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L54
257+
*/
237258
const updateUser = useCallback(
238259
(fields: object) => {
239260
if (!user) {
@@ -247,6 +268,9 @@ export function useNetlifyIdentity(
247268
[user]
248269
);
249270

271+
/**
272+
* @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L63
273+
*/
250274
const getFreshJWT = useCallback(() => {
251275
if (!user) {
252276
throw new Error(errors.noUserFound);
@@ -255,6 +279,9 @@ export function useNetlifyIdentity(
255279
return user.jwt();
256280
}, [user]);
257281

282+
/**
283+
* @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L71
284+
*/
258285
const logoutUser = useCallback(() => {
259286
if (!user) {
260287
throw new Error(errors.noUserFound);

0 commit comments

Comments
 (0)