Skip to content

Commit

Permalink
final customization and fix for error - see truffle-box/react-auth-bo…
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsojp committed Jul 22, 2018
1 parent 2b199cc commit c9c3dc5
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build/contracts/Migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1383,5 +1383,5 @@
}
},
"schemaVersion": "2.0.0",
"updatedAt": "2018-07-18T20:05:46.472Z"
"updatedAt": "2018-07-22T01:50:14.834Z"
}
2 changes: 1 addition & 1 deletion build/contracts/SimpleStorage.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,5 +561,5 @@
}
},
"schemaVersion": "2.0.0",
"updatedAt": "2018-07-18T20:05:46.469Z"
"updatedAt": "2018-07-22T01:50:14.833Z"
}
40 changes: 16 additions & 24 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
"test": "node scripts/testrun.js --env=jsdom"
},
"jest": {
"collectCoverageFrom": [
Expand Down
File renamed without changes.
12 changes: 11 additions & 1 deletion src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'

// edited due to error - see https://github.com/truffle-box/react-auth-box/issues/21
import { Provider } from 'react-redux'
import store from './store'

it('renders without crashing', () => {
const div = document.createElement('div')
ReactDOM.render(<App />, div)
ReactDOM.render((
<Provider store={store}>
<App />
</Provider>
),
div
)
})
5 changes: 2 additions & 3 deletions src/user/ui/loginbutton/LoginButtonActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function userLoggedIn(user) {
}

export function loginUser() {
return function(dispatch) {
return function (dispatch) {
// UPort and its web3 instance are defined in ./../../../util/wrappers.
// Request uPort persona of account passed via QR
uport.requestCredentials({
Expand All @@ -22,8 +22,7 @@ export function loginUser() {
// This way, once logged in a user can still access the home page.
var currentLocation = browserHistory.getCurrentLocation()

if ('redirect' in currentLocation.query)
{
if ('redirect' in currentLocation.query) {
return browserHistory.push(decodeURIComponent(currentLocation.query.redirect))
}

Expand Down
14 changes: 9 additions & 5 deletions src/util/connectors.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { Connect, SimpleSigner } from 'uport-connect'
export let uport = new Connect('React Uport Truffle Boilerplate', {
clientId: '2ofNaNxZcEjK6jFCnkjCAo98fhgoAEXKFac',
network: 'rinkeby',
signer: SimpleSigner('3dff3eeaf5f56eb252fe4e01b720b199c8520812d9e87c8336c79fcee01c3e3a')
})

//export let uport = new Connect('TruffleBox')

export let uport = new Connect('ReactUport Box2', {
clientId: '2ok5fycGvGXiU2t5KtBvntNJxkrKPhT9HJE',
network: 'rinkeby',
signer: SimpleSigner('509f9d88171b27d705e59076a4c70eec4ce1e23a0586ec678d0481b1c8f9b791')
})

export const web3 = uport.getWeb3()

0 comments on commit c9c3dc5

Please sign in to comment.