Skip to content

Commit 5d9bc65

Browse files
authored
fix: authentication onBeforeRequest callback support async function (#67)
1 parent c0c4641 commit 5d9bc65

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/functions/tokenAuthentication/createTokenAuthentication.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const createClientTokenAuthentication = ({
6262
if (!isVisitorRole && !isLoginRole) {
6363
await assignToken(method);
6464
}
65-
onBeforeRequest?.(method);
65+
return onBeforeRequest?.(method);
6666
},
6767
onResponseRefreshToken: onRespondedHandlers => {
6868
const respondedRecord = onResponded2Record(onRespondedHandlers);
@@ -113,7 +113,7 @@ export const createServerTokenAuthentication = ({
113113
if (!isVisitorRole && !isLoginRole) {
114114
await assignToken(method);
115115
}
116-
onBeforeRequest?.(method);
116+
return onBeforeRequest?.(method);
117117
},
118118
onResponseRefreshToken: onRespondedHandlers => {
119119
const respondedRecord = onResponded2Record(onRespondedHandlers);

0 commit comments

Comments
 (0)