You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the SaleorExternalAuth class already provides an obtainAccessToken method, we could simplify the code by creating a function within the hook that wraps this method with error handling. This would allow us to obtain the access token directly from useSaleorExternalAuth, without needing to initialize the class separately, and centralize error management in the hook.
Proposed Solution:
Add a function within useSaleorExternalAuth that wraps obtainAccessToken with error handling.
Return this function from the hook along with the existing state, enabling token access and error handling from the hook itself.
Context: I'm currently upgrading the dashboard app with the newly developed auth-sdk and deprecating the old saleor-sdk. This change would streamline the implementation by managing the error states centrally within the hook.
The text was updated successfully, but these errors were encountered:
Currently,
useSaleorExternalAuth
returns an object of typeSaleorExternalAuthState
, structured as follows:Since the
SaleorExternalAuth
class already provides anobtainAccessToken
method, we could simplify the code by creating a function within the hook that wraps this method with error handling. This would allow us to obtain the access token directly fromuseSaleorExternalAuth
, without needing to initialize the class separately, and centralize error management in the hook.Proposed Solution:
Add a function within useSaleorExternalAuth that wraps
obtainAccessToken
with error handling.Return this function from the hook along with the existing state, enabling token access and error handling from the hook itself.
Context: I'm currently upgrading the dashboard app with the newly developed auth-sdk and deprecating the old saleor-sdk. This change would streamline the implementation by managing the error states centrally within the hook.
The text was updated successfully, but these errors were encountered: