Commit 56282d87 by Ashiqur Rahman

add state body

parent 7f16101a
Pipeline #149 failed with stages
......@@ -6,10 +6,11 @@ class App extends Component {
constructor() {
super();
this.state = {
"aud": "jitsi",
"sub": "meet3.synesisit.info",
"nbf": 1603793119,
"context": {
body: {
"aud": "jitsi",
"sub": "meet3.synesisit.info",
"nbf": 1603793119,
"context": {
"user": {
"avatar": "http://google.com",
"name": "nah",
......@@ -23,11 +24,12 @@ class App extends Component {
"exp": 1603879519,
"iat": 1603793119,
"room": "VideoConf"
}
}
}
setToken() {
localStorage.setItem('token', ""+CryptoJS.SHA256(this.state.name));
localStorage.setItem('token', ""+CryptoJS.SHA256(JSON.stringify(this.state.body)));
}
render() {
......@@ -35,7 +37,8 @@ class App extends Component {
<div>
<h1>Simple JWT token App</h1>
<div>
<input type="text" placeholder="Room name:" onChange={(event) => {this.setState({roomName: event.target.value})}} />
{/* <input type="text" placeholder="Room name:" onChange={(event) => {this.setState({roomName: event.target.value})}} /> */}
<input type="text" placeholder="Room name:" onChange={(event) => {this.setState({body:{context:{user:{roomName: event.target.value}}}})}} />
<br></br>
<button onClick={() => {this.setToken()}}>Login</button>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment