Skip to content

Instantly share code, notes, and snippets.

@ivanvs
Created July 1, 2017 22:29
Show Gist options
  • Save ivanvs/9be9d4cc3127c439d58d0f5299c17a07 to your computer and use it in GitHub Desktop.
Save ivanvs/9be9d4cc3127c439d58d0f5299c17a07 to your computer and use it in GitHub Desktop.
React example how to do authenitcation with Bitbucket
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