Skip to content
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
6 changes: 6 additions & 0 deletions packages/authentication/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @baseapp-frontend/authentication

## 4.1.1

### Patch Changes

- Remove `getExpoConstant` from `preAuthenticateJWT` since it is being used on the web app middleware.

## 4.1.0

### Minor Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { getExpoConstant } from '@baseapp-frontend/utils'
import type { JWTResponse } from '@baseapp-frontend/utils/types/jwt'

/**
* This function is intended for web usage only
* because it relies on `NEXT_PUBLIC_API_BASE_URL`.
*/
const preAuthenticateJWT = async (token?: string) => {
try {
if (!token) {
throw new Error('No token provided.')
}

const EXPO_PUBLIC_API_BASE_URL = getExpoConstant('EXPO_PUBLIC_API_BASE_URL')
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_BASE_URL ?? EXPO_PUBLIC_API_BASE_URL}/auth/pre-auth/jwt`,
{
method: 'POST',
body: JSON.stringify({ token }),
cache: 'no-store',
headers: {
'Content-Type': 'application/json',
},
const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/auth/pre-auth/jwt`, {
method: 'POST',
body: JSON.stringify({ token }),
cache: 'no-store',
headers: {
'Content-Type': 'application/json',
},
)
})

if (response instanceof Response && !response.ok) {
throw new Error('Failed to pre-authenticate.')
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": "4.1.0",
"version": "4.1.1",
"main": "./index.ts",
"types": "dist/index.d.ts",
"sideEffects": false,
Expand Down
7 changes: 7 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @baseapp-frontend/components

## 0.0.45

### Patch Changes

- Updated dependencies
- @baseapp-frontend/authentication@4.1.1

## 0.0.44

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@baseapp-frontend/components",
"description": "BaseApp components modules such as comments, notifications, messages, and more.",
"version": "0.0.44",
"version": "0.0.45",
"main": "./index.ts",
"types": "dist/index.d.ts",
"sideEffects": false,
Expand Down
Loading