Skip to content

Commit

Permalink
Waves Keeper Auth integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
mechiko committed Aug 28, 2019
1 parent 112fb17 commit ddb7e3d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/build.js

Large diffs are not rendered by default.

24 changes: 20 additions & 4 deletions src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,33 @@ class App extends React.Component {
constructor(props) {
super(props);
this.state = {}
this.authFunc = this.authFunc.bind(this);
}
authFunc() {
const authData = { data: "Auth on my site" };
if (WavesKeeper) {
WavesKeeper.auth( authData )
.then(auth => {
console.log( auth ); //displaying the result on the console
/*...processing data */
}).catch(error => {
console.error( error ); // displaying the result on the console
/*...processing errors */
})
} else {
alert("To Auth WavesKeeper should be installed.");
}
}
render() {
return (
<div className="container">
<input className="btn btn-primary" type="submit" value="Alert" onClick={() => {alert("Alert button onClick");}}/>
</div>
<div className="container">
<input className="btn btn-primary" type="submit" value="Auth" onClick={this.authFunc}/>
</div>
)
}
}

const app = document.getElementById('app');
if(app){
ReactDOM.render(<App/>, app);
}
}

0 comments on commit ddb7e3d

Please sign in to comment.