Created
July 1, 2017 22:29
-
-
Save ivanvs/9be9d4cc3127c439d58d0f5299c17a07 to your computer and use it in GitHub Desktop.
React example how to do authenitcation with Bitbucket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { | |
let content = !!this.state.isAuthenticated ? | |
( | |
<div> | |
<p>Authenticated</p> | |
<div> | |
{this.state.user.email} | |
</div> | |
<div> | |
<button onClick={this.logout} className="button" > | |
Log out | |
</button> | |
</div> | |
</div> | |
) : | |
( | |
<button onClick={this.bitbucketLogin} className="button"> | |
Bitbucket Login | |
</button>); | |
return ( | |
<div className="App"> | |
{content} | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment