This repository was archived by the owner on Jan 20, 2024. It is now read-only.
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
client-oauth breaks on Edge runtime because of window.btoa #206
Open
Description
The Edge runtime neither has access to Buffer nor window. It does however has access to btoa directly.
I'm using it in my NextJS middleware that runs on the Edge middleware
If I change it like this it works fine for me. And I don't think it'll break any other scenario, right?
- var btoa
if (typeof Buffer === 'function') {
btoa = btoaBuffer
+ } else if(typeof window !== 'undefined') {
btoa = window.btoa.bind(window)
}
Metadata
Metadata
Assignees
Labels
No labels