@auth0/auth0-react 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.tsx CHANGED
@@ -47,7 +47,7 @@ export const deprecateRedirectUri = (options?: any) => {
47
47
  console.warn(
48
48
  'Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version'
49
49
  );
50
- options.authorizationParams = options.authorizationParams || {};
50
+ options.authorizationParams = options.authorizationParams ?? {};
51
51
  options.authorizationParams.redirect_uri = options.redirectUri;
52
52
  delete options.redirectUri;
53
53
  }
@@ -117,11 +117,11 @@ const withAuthenticationRequired = <P extends object>(
117
117
  const opts = {
118
118
  ...loginOptions,
119
119
  appState: {
120
- ...(loginOptions && loginOptions.appState),
120
+ ...loginOptions?.appState,
121
121
  returnTo: typeof returnTo === 'function' ? returnTo() : returnTo,
122
122
  },
123
123
  };
124
- (async (): Promise<void> => {
124
+ void (async (): Promise<void> => {
125
125
  await onBeforeAuthentication();
126
126
  await loginWithRedirect(opts);
127
127
  })();