mirror of
https://github.com/suitenumerique/meet.git
synced 2026-10-11 23:52:00 +00:00
ddf19deb82
Wire the frontend to the backend's token exchange flow: when the expected URL fragment is present, gate the app loading on exchanging that fragment for a proper access token, which is then used to interact with the API. When no such fragment is present, the code path is a no-op and should have minimal impact on load performance.
11 lines
383 B
TypeScript
11 lines
383 B
TypeScript
import { useLocationProperty } from 'wouter/use-browser-location'
|
|
|
|
const hashSelector = () =>
|
|
typeof window !== 'undefined' ? window.location.hash : ''
|
|
|
|
/**
|
|
* Reactive window.location.hash, subscribed to wouter's navigation
|
|
* events (the same low-level primitive wouter builds useSearch upon).
|
|
*/
|
|
export const useHash = (): string => useLocationProperty(hashSelector, () => '')
|