fix(5g-api): Authentication problem with location action
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import verifyCredentials from './verify-credentials';
|
import verifyCredentials from './verify-credentials';
|
||||||
// import isStillVerified from './is-still-verified';
|
import isStillVerified from './is-still-verified';
|
||||||
// import refreshToken from './refresh-token';
|
// import refreshToken from './refresh-token';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
import { IGlobalVariable } from '@automatisch/types';
|
||||||
|
|
||||||
|
const isStillVerified = async ($: IGlobalVariable) => {
|
||||||
|
// const user = await getCurrentUser($);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default isStillVerified;
|
13
packages/backend/src/apps/5g-api/common/add-auth-header.ts
Normal file
13
packages/backend/src/apps/5g-api/common/add-auth-header.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { TBeforeRequest } from '@automatisch/types';
|
||||||
|
|
||||||
|
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||||
|
const { accessToken } = $.auth.data;
|
||||||
|
|
||||||
|
if (accessToken) {
|
||||||
|
requestConfig.headers.Authorization = `Bearer ${accessToken}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return requestConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default addAuthHeader;
|
@@ -1,5 +1,5 @@
|
|||||||
import defineApp from '../../helpers/define-app';
|
import defineApp from '../../helpers/define-app';
|
||||||
// import addAuthHeader from './common/add-auth-header';
|
import addAuthHeader from './common/add-auth-header';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
import actions from './actions';
|
import actions from './actions';
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ export default defineApp({
|
|||||||
baseUrl: 'https://developer.telekom.de',
|
baseUrl: 'https://developer.telekom.de',
|
||||||
apiBaseUrl: 'https://api.developer.telekom.de',
|
apiBaseUrl: 'https://api.developer.telekom.de',
|
||||||
primaryColor: 'e20074',
|
primaryColor: 'e20074',
|
||||||
// beforeRequest: [addAuthHeader],
|
beforeRequest: [addAuthHeader],
|
||||||
auth,
|
auth,
|
||||||
actions,
|
actions,
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user