@@ -163,6 +163,9 @@ export function useNetlifyIdentity(
163
163
// 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
164
164
/******* external oauth */
165
165
166
+ /**
167
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L71
168
+ */
166
169
const loginProvider = useCallback (
167
170
( provider : Provider ) => {
168
171
const url = goTrueInstance . loginExternalUrl ( provider ) ;
@@ -171,6 +174,9 @@ export function useNetlifyIdentity(
171
174
[ goTrueInstance ]
172
175
) ;
173
176
177
+ /**
178
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L92
179
+ */
174
180
const acceptInviteExternalUrl = useCallback (
175
181
( provider : Provider ) => {
176
182
if ( ! param . token || param . type !== 'invite' ) {
@@ -187,6 +193,9 @@ export function useNetlifyIdentity(
187
193
) ;
188
194
189
195
/******* email auth */
196
+ /**
197
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L50
198
+ */
190
199
const signupUser = useCallback (
191
200
(
192
201
email : string ,
@@ -204,17 +213,26 @@ export function useNetlifyIdentity(
204
213
[ goTrueInstance , _setUser ]
205
214
) ;
206
215
216
+ /**
217
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L57
218
+ */
207
219
const loginUser = useCallback (
208
220
( email : string , password : string , remember : boolean = true ) =>
209
221
goTrueInstance . login ( email , password , remember ) . then ( _setUser ) ,
210
222
[ goTrueInstance , _setUser ]
211
223
) ;
212
224
225
+ /**
226
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L80
227
+ */
213
228
const requestPasswordRecovery = useCallback (
214
229
( email : string ) => goTrueInstance . requestPasswordRecovery ( email ) ,
215
230
[ goTrueInstance ]
216
231
) ;
217
232
233
+ /**
234
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/index.js#L87
235
+ */
218
236
const recoverAccount = useCallback (
219
237
( remember ?: boolean ) => {
220
238
if ( ! param . token || param . type !== 'recovery' ) {
@@ -234,6 +252,9 @@ export function useNetlifyIdentity(
234
252
[ goTrueInstance , _setUser , param ]
235
253
) ;
236
254
255
+ /**
256
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L54
257
+ */
237
258
const updateUser = useCallback (
238
259
( fields : object ) => {
239
260
if ( ! user ) {
@@ -247,6 +268,9 @@ export function useNetlifyIdentity(
247
268
[ user ]
248
269
) ;
249
270
271
+ /**
272
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L63
273
+ */
250
274
const getFreshJWT = useCallback ( ( ) => {
251
275
if ( ! user ) {
252
276
throw new Error ( errors . noUserFound ) ;
@@ -255,6 +279,9 @@ export function useNetlifyIdentity(
255
279
return user . jwt ( ) ;
256
280
} , [ user ] ) ;
257
281
282
+ /**
283
+ * @see https://github.com/netlify/gotrue-js/blob/master/src/user.js#L71
284
+ */
258
285
const logoutUser = useCallback ( ( ) => {
259
286
if ( ! user ) {
260
287
throw new Error ( errors . noUserFound ) ;
0 commit comments