Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BA: middleware fix #94

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/authentication/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @baseapp-frontend/authentication

## 2.1.3

### Patch Changes

- Remove barrel file imports since such functions are meant to be used in a `middleware`.
- Updated dependencies
- @baseapp-frontend/utils@2.2.3

## 2.1.2

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IJWTResponse, baseAppFetch } from '@baseapp-frontend/utils'
import { baseAppFetch } from '@baseapp-frontend/utils/functions/fetch/baseAppFetch'
import type { IJWTResponse } from '@baseapp-frontend/utils/types/jwt'

const preAuthenticateJWT = async (token?: string) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/authentication/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@baseapp-frontend/authentication",
"description": "Authentication modules.",
"version": "2.1.2",
"version": "2.1.3",
"main": "./dist/index.ts",
"module": "./dist/index.mjs",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions packages/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @baseapp-frontend/utils

## 2.2.3

### Patch Changes

- Use native include instead of `lodash`.

## 2.2.2

### Patch Changes
Expand Down
3 changes: 1 addition & 2 deletions packages/utils/functions/fetch/baseAppFetch/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import humps from 'humps'
import includes from 'lodash/includes'

import { ACCESS_COOKIE_NAME, REFRESH_COOKIE_NAME } from '../../../constants/cookie'
import { LOGOUT_EVENT } from '../../../constants/events'
Expand Down Expand Up @@ -126,7 +125,7 @@ export const baseAppFetch: BaseAppFetch = async (

// set content-type header
const methodsToSetContentType = ['POST', 'PUT', 'PATCH']
if (setContentType && includes(methodsToSetContentType, fetchOptions.method)) {
if (setContentType && methodsToSetContentType.includes(fetchOptions.method || '')) {
fetchOptions.headers!['Content-Type'] = 'application/json'
}

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@baseapp-frontend/utils",
"description": "Util functions, constants and types.",
"version": "2.2.2",
"version": "2.2.3",
"main": "./dist/index.ts",
"module": "./dist/index.mjs",
"scripts": {
Expand Down
Loading