forked from 5apps/unhosted-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
token.html
4 lines (3 loc) · 3.06 KB
/
token.html
1
2
3
4
<!DOCTYPE html> <html> <head> <title>token.js</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> token.js </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">¶</a> </div> </td> <td class="code"> <div class="highlight"><pre><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">¶</a> </div> <p><code>receiveToken</code> parses the OAuth token from the URL params</p> </td> <td class="code"> <div class="highlight"><pre> <span class="kd">var</span> <span class="nx">token</span> <span class="o">=</span> <span class="nx">remoteStorage</span><span class="p">.</span><span class="nx">receiveToken</span><span class="p">();</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">¶</a> </div> <p>We send the token <a href="tutorial.html">back to our main page</a></p> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">window</span><span class="p">.</span><span class="nx">opener</span><span class="p">.</span><span class="nx">postMessage</span><span class="p">(</span><span class="nx">token</span><span class="p">,</span> <span class="nx">location</span><span class="p">.</span><span class="nx">protocol</span><span class="o">+</span><span class="s1">'//'</span><span class="o">+</span><span class="nx">location</span><span class="p">.</span><span class="nx">host</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">¶</a> </div> <p>and close the window.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">window</span><span class="p">.</span><span class="nx">close</span><span class="p">();</span>
<span class="p">})();</span>
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>