Skip to content

Commit

Permalink
Merge pull request #1 from provenance-io/remove-auth
Browse files Browse the repository at this point in the history
remove auth flow
  • Loading branch information
piercetrey-figure authored Jun 14, 2021
2 parents b242d95 + 4b5d138 commit f6b018e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 144 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ jobs:
- name: Build image
run: docker build . --file docker/Dockerfile --tag "p8e-ui:$VERSION"

- name: Log into registry
run: echo "${{ secrets.DOCKER_REGISTRY_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Push image
run: |
Expand All @@ -103,3 +107,11 @@ jobs:
docker tag "p8e-ui:$VERSION" $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
PRERELEASE=${{ github.event.release.prerelease }}
echo PRERELEASE=$PRERELEASE
if [ "$PRERELEASE" == "false" ]; then
docker tag "p8e-ui:$VERSION" $IMAGE_ID:latest
docker push $IMAGE_ID:latest
fi
26 changes: 2 additions & 24 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,13 @@
import React, { useEffect } from 'react';
import React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import DashboardContainer from 'components/Dashboard/DashboardContainer';
import { ContractContainer, ContractListContainer } from 'components/Contract';
import { LoginContainer } from 'components/Login';
import { KeyManagerContainer, AddServiceKeyModal } from 'components/KeyManagement';
import { OAuthCallback } from 'components/OAuth';
import KeyDetailsContainer from 'components/KeyManagement/KeyDetailsContainer';
import { ScopeContainer, ScopeHistoryContainer, ScopeListContainer } from 'components/Scopes';
import { Settings } from 'Constant';
import { useDeepLink } from 'hooks';

const App = ({ isAuthenticated }) => {
const { performDeepLink } = useDeepLink();

useEffect(() => {
if (isAuthenticated) {
performDeepLink();
}
}, [isAuthenticated, performDeepLink]);

if (!isAuthenticated) {
return (
<>
<Switch>
<Route exact path="/oauth/callback" component={OAuthCallback} />
</Switch>
<LoginContainer />
</>
);
}

const App = () => {
return (
<>
<Switch>
Expand Down
6 changes: 1 addition & 5 deletions src/AppContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import React from 'react';
import { useSelector } from 'react-redux';
import App from 'App';
import { ErrorCardContainer } from 'components/ErrorCards';

export const AppContainer = () => {
const { jwt } = useSelector(({ identityReducer }) => identityReducer);
const isAuthenticated = typeof jwt === 'string' && jwt.length > 0;

return (<>
<App isAuthenticated={isAuthenticated} />
<App />
<ErrorCardContainer />
</>);
}
22 changes: 0 additions & 22 deletions src/interceptors/401-interceptor.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/interceptors/index.ts

This file was deleted.

47 changes: 0 additions & 47 deletions src/interceptors/jwt-interceptor.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/reducers/identity-reducer.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import { default as contractReducer } from './contract-reducer';
import { default as scopeReducer } from './scope-reducer';
import { default as objectReducer } from './object-reducer';
import { default as keyReducer } from './key-reducer';
import { default as identityReducer } from './identity-reducer';
import { default as errorReducer } from './error-reducer';

export default {
contractReducer,
scopeReducer,
objectReducer,
keyReducer,
identityReducer,
errorReducer,
};
3 changes: 0 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { applyMiddleware, createStore, combineReducers, compose } from 'redux';
import thunk from 'redux-thunk';
import rootReducer from 'reducers';
import { setup401Interceptor } from 'interceptors';

const middleware = [
thunk, // thunk middleware allows us to return promises from and receive dispatch reference in redux action creators.
Expand All @@ -23,6 +22,4 @@ const composedEnhancers = compose(applyMiddleware(...middleware), ...enhancers);

const store = createStore(combineReducers({ ...rootReducer }), preloadedState, composedEnhancers);

setup401Interceptor();

export default store;

0 comments on commit f6b018e

Please sign in to comment.