Cris Acosta
11/09/2021, 6:01 PMScott P
11/09/2021, 6:12 PMts
export interface ISupabaseDeepLink {
access_token: string;
expires_in: string;
refresh_token: string;
token_type: string;
type: string;
}
function hashToObject(entries) {
const result = {};
for (const [key, value] of entries) {
result[key] = value;
}
return result;
}
const params = new URLSearchParams(window.location.hash.replace("#", ""));
const parsedParams: ISupabaseDeepLink = hashToObject(
params
) as ISupabaseDeepLink;
If you console.log(parsedParams)
, you'll see an object which includes the parameters from the URLCris Acosta
11/09/2021, 7:59 PMsilentworks
11/10/2021, 10:28 AMsupabase-js
library, the above that @User has given you would be applicable at that point