on 8aed2cb help sign in
bridge/src/lib/useImpliedTicket.js
14 lines 347 B history raw
1import * as ob from 'urbit-ob';
3import { prependSig } from './transformers';
5/**
6 * pull the suggested ticket from the #hash in the url
7 */
8export default function useImpliedTicket() {
9 const hash = window.location.hash.slice(1);
10 const ticket = prependSig(hash);
11 const isValid = ob.isValidPatq(ticket);
13 return isValid ? ticket : null;