Created
October 21, 2021 09:48
-
-
Save jokamjohn/2a351285c6bc262b018e7a051a57cacf to your computer and use it in GitHub Desktop.
This file contains 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
/*global chrome*/ | |
import './App.css'; | |
import {useEffect} from "react"; | |
const sendTokenToChromeExtension = ({ extensionId, jwt}) => { | |
chrome.runtime.sendMessage(extensionId, { jwt }, response => { | |
if (!response.success) { | |
console.log('error sending message', response); | |
return response; | |
} | |
console.log('Sucesss ::: ', response.message) | |
}); | |
} | |
function App() { | |
useEffect(() => { | |
sendTokenToChromeExtension({ extensionId: 'joeibnoddmkbggaacjmfnefdmpdgpkmb', jwt: 'xxxxx.yyyyy.zzzzz'}) | |
}, []) | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<h1>Chrome extension Token authentication</h1> | |
<p>The token to be sent is <code>xxxxx.yyyyy.zzzzz</code></p> | |
</header> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment