preAuthenticateJWT
uses normal fetch to avoid Node.js module not supported in the Edge Runtime error when used in themiddleware
.- Standardize some of dependencies versions.
- Updated dependencies
- @baseapp-frontend/provider@2.0.1
- Migrate to React Query v5. This includes adapting the code due to breaking changes of the library.
- Update several dependencies.
- Remove deprecated
usePreAuth
hook. We should now pre authenticate on the server side using thepreAuthenticate
function. - Renamed a couple of type interfaces, mainly removing the
I
prefix from it. - Move
react
,@baseapp-frontend/provider
and@baseapp-frontend/utils
topeerDependencies
for better compatibility between the packages and the consumer app.
- Updated dependencies
- @baseapp-frontend/provider@2.0.0
- @baseapp-frontend/utils@2.4.0
- The
useJWTUser
hook now usesgetUser
function to retrieve the user's data. ThenoSSR
option is set tofalse
by default, which allows cookies to be retrieved right away on the server, but also forces the Next.js page to be dynamically rendered. - The
getUser
is no longer an async function or returns awaits for thegetToken
return. - The
withUser
is no longer an async function or returns awaits for thegetUser
return.
- Updated dependencies
- @baseapp-frontend/utils@2.3.0
- Remove barrel file imports since such functions are meant to be used in a
middleware
. - Updated dependencies
- @baseapp-frontend/utils@2.2.3
- Add
preAuthenticateJWT
function to be used on the server side. - Deprecates the
usePreAuth
hook. - Updated dependencies
- @baseapp-frontend/utils@2.2.2
- Export variables from
services/auth
- Create
useJWTUser
anduseUpdateUser
for user management in the client side using JWT. - Rename the constant
PRE_AUTH_API_KEY
toAUTH_API_KEY
. - Add
phoneNumber
field to theIUser
interface.
- Updated dependencies
- @baseapp-frontend/utils@2.1.0
- Creates
withUser
HOC andComponentWithUser
type.withUser
's JSDoc contains a more detailed information about its usage.
- The getUser function is async now, handle accordingly.
- Some types were added to make testing easier.
- Updated dependencies [2300f2d]
- @baseapp-frontend/utils@2.0.0
- Remove the import from barrel files inside the
getUser
function. - This has become necessary because we are not eliminating not used code that comes with the barrel file, and functions like
getUser
can be executed in environments that do not support some features that are being exported in the same barrel file, likeuseDebounce
.
- Add
emitLogoutEvent
option to theuseLogout
hook. By default, it will emit theLOGOUT_EVENT
. That's useful when you have subscribed to that event and want to execute some action after the event is triggered. - Updated dependencies
- @baseapp-frontend/utils@1.4.2
- Creates a
getUser
function that allows to get the user token on the server side and can be used by both Client and Server Components. - Deprecates the
useUser
hook. - Updated dependencies
- @baseapp-frontend/utils@1.4.0
- Add
enableFormApiErrors
option to all the hooks that were usingsetFormApiErrors
. It now conditionally sets form errors based on the API response. - Add the
mode
option to theuseSignUp
hook. - Updated dependencies
- @baseapp-frontend/utils@1.3.7
- Pre Authenticated URL handling
- Short URL handling
- Remove
acceptConsent
andphoneNumber
from signup form validations - Add password validations for
useSignup
- Updated dependencies
- @baseapp-frontend/utils@1.3.5
- Replaces
yup
forzod
as schema validation utility. - Add tests to
defaultValues
andvalidationSchema
props to ensure that customization works.
- Updated dependencies
- @baseapp-frontend/utils@1.3.1
-
Update
useResetPassword
so it expects to receive a token as a hook parameter. -
Set
onBlur
mode for most of the hookes that usesuseForm
. -
Add a
{}
fallback for some hook'`s options. -
Updated dependencies
- @baseapp-frontend/utils@1.3.0
- Update auth endpoint url path to match baseapp-django-v3. The default login path is
/auth/login
for both Simple Token and JWT auth.
- Add an
ApiClass
option to all hooks that use some internal api class likeAuthApi
orUserApi
. The user would be able to use its own api class, as long it has the required methods that each hook needs.
-
Add types to
handleLoginSuccess
function. -
Updated dependencies
- @baseapp-frontend/utils@1.2.1
- Added the JWT authentication flow and tools
- Updated dependencies
- @baseapp-frontend/utils@1.2.0
-
Redesigning
useLogout
hook- It now returns an object instead of a function
- It now uses
resetQueries
instead ofinvalidateQueries
in order to reset the user cache properly.
-
Updated dependencies
- @baseapp-frontend/utils@1.1.0
- Reset user cache when
useUser
throws a 401 error.- It was using
invalidateQueries
but this doesn't necessarily clean the user cache response, so changing toresetQueries
is more effective.
- It was using
- Allows more hook's options to be overridable.
- Updated dependencies
- @baseapp-frontend/utils@1.0.1
- Creates Authentication package.
- Creates
access
,mfa
anduser
modules alongside its services api's and types. - Migrate authentication methods and tests from the
core
package.
- Updated dependencies
- @baseapp-frontend/provider@1.0.0
- @baseapp-frontend/utils@1.0.0