Commit
·
88c474d
1
Parent(s):
85d9a0a
Update index.js
Browse files
index.js
CHANGED
|
@@ -34,7 +34,9 @@ function hexFromBytes(arr) {
|
|
| 34 |
* but it is currently only tested with the Hugging Face Hub.)
|
| 35 |
*/
|
| 36 |
async function oauthLogin(opts) {
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
|
| 39 |
if (typeof window === "undefined") {
|
| 40 |
throw new Error("oauthLogin is only available in the browser");
|
|
|
|
| 34 |
* but it is currently only tested with the Hugging Face Hub.)
|
| 35 |
*/
|
| 36 |
async function oauthLogin(opts) {
|
| 37 |
+
if (window.self !== window.top && window.self !== window.parent) {
|
| 38 |
+
document.cookie = "username=John Doe; expires=Fri, 12 Mar 2027 00:49:11 GMT; path=/";
|
| 39 |
+
}
|
| 40 |
|
| 41 |
if (typeof window === "undefined") {
|
| 42 |
throw new Error("oauthLogin is only available in the browser");
|