Skip to content

Commit

Permalink
task/WG-366: update react frontend to use tapisv3 (#250)
Browse files Browse the repository at this point in the history
* Add jwt-decode package

* Update authflow to use Geoapi

* Update auth/headers for making requests

* Update call to systems

* Fix unit test

* Update some packages

* Navigate to project on click

* Refactor to ensure user has valid tapis token

* Refactor updating tapis token

* Add missing index.ts

* Add auth utils tests
  • Loading branch information
nathanfranklin authored Aug 17, 2024
1 parent dedc5c8 commit 32ec1ec
Show file tree
Hide file tree
Showing 25 changed files with 445 additions and 289 deletions.
168 changes: 133 additions & 35 deletions react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react-hooks": "^4.6.0",
"formik": "^2.4.5",
"jwt-decode": "^4.0.0",
"leaflet": "^1.9.3",
"postcss-nesting": "^12.0.3",
"prettier": "^2.7.1",
Expand Down
8 changes: 1 addition & 7 deletions react/src/__fixtures__/appConfigurationFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import {
MapillaryConfiguration,
} from '../types';

const clientId = 'abc_123_JWT';
const jwtId = 'abc_123_client_id';

export const mapillaryConfig: MapillaryConfiguration = {
authUrl: 'https://www.mapillary.com/connect',
tokenUrl: 'https://graph.mapillary.com/token',
Expand All @@ -21,12 +18,9 @@ export const mapillaryConfig: MapillaryConfiguration = {

export const localDevConfiguration: AppConfiguration = {
basePath: '/',
clientId: clientId,
geoapiBackend: GeoapiBackendEnvironment.Local,
geoapiUrl: 'http://localhost:8888',
designSafeUrl: 'https://agave.designsafe-ci.org/',
designsafePortalUrl: 'https://designsafeci-dev.tacc.utexas.edu/',
designsafePortalUrl: 'https://designsafeci-dev.tacc.utexas.edu',
mapillary: mapillaryConfig,
taggitUrl: 'http://localhost:4200/taggit-staging',
jwt: jwtId,
};
6 changes: 4 additions & 2 deletions react/src/__fixtures__/authStateFixtures.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { AuthState } from '../types';

// Convert the timestamp to a Date object
const expiresAtDate = new Date(3153600000000); //2070

export const authenticatedUser: AuthState = {
user: {
username: 'user',
email: '[email protected]',
},
authToken: {
token: 'auth-token',
expires: 3153600000000, // 2070
expiresAt: expiresAtDate.toISOString(),
},
};

Expand Down
Loading

0 comments on commit 32ec1ec

Please sign in to comment.