Skip to content

Instantly share code, notes, and snippets.

View robinvanderknaap's full-sized avatar

Robin van der Knaap robinvanderknaap

View GitHub Profile
@werthdavid
werthdavid / cross-tab-storage.ts
Created April 25, 2019 08:04
Special Storage-Implementation that uses sessionStorage (like the default of the OAuth-library) but also sets a marker in localStorage so that other Browser-Tabs get notified when the user on this Tab logs out.
/**
* Special Storage-Implementation that uses sessionStorage (like the default of the
* OAuth-library) but also sets a marker in localStorage so that other Browser-Tabs
* get notified when the user on this Tab logs out.
*/
export class CrossTabStorage extends OAuthStorage {
readonly MARKER_KEY = "LOGGED_IN";
constructor() {
@bq1990
bq1990 / gist:595c615970250e97f3ea
Created December 17, 2014 15:55
Supertest authenticate with bearer token
'use strict';
var should = require('should');
var app = require('../../app');
var request = require('supertest')(app);
describe('GET /api/incidents', function() {
it('should require authorization', function(done) {
request