Feature(authentication): pass authentication repository in sign in/sign up callbacks #55

Closed
opened 2022-12-03 22:06:45 +00:00 by hugo · 0 comments
Owner

from

final AuthenticationRepository<Session> authenticationRepository =
 	...
    onSignUpSuccess: (account, form) => ...,
    onAuthChange: (account) => ...,
);

to

final AuthenticationRepository<Session> authenticationRepository =
 	...
    onSignUpSuccess: (repo, account, form) => ...,
    onAuthChange: (repo, account) => ...,
);

Because sometimes in authentication usecases you'll need access the repo. For example when you want to retrieve refreshToken you can use:

repo.getIdentityToken();
from ```dart final AuthenticationRepository<Session> authenticationRepository = ... onSignUpSuccess: (account, form) => ..., onAuthChange: (account) => ..., ); ``` to ```dart final AuthenticationRepository<Session> authenticationRepository = ... onSignUpSuccess: (repo, account, form) => ..., onAuthChange: (repo, account) => ..., ); ``` Because sometimes in authentication usecases you'll need access the repo. For example when you want to retrieve `refreshToken` you can use: ```dart repo.getIdentityToken(); ```
hugo self-assigned this 2022-12-03 22:06:45 +00:00
hugo added this to the (deleted) project 2022-12-03 22:14:18 +00:00
malo closed this issue 2022-12-03 23:55:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Wyatt-FOSS/wyatt-packages#55
No description provided.