ahmedyradwan02 commited on
Commit
91c3d77
·
verified ·
1 Parent(s): f163d41

Sign-in must grant the Deep-Fake org

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. index.html +9 -3
README.md CHANGED
@@ -4,6 +4,7 @@ sdk: static
4
  hf_oauth: true
5
  hf_oauth_scopes:
6
  - write-repos
 
7
  pinned: false
8
  ---
9
 
 
4
  hf_oauth: true
5
  hf_oauth_scopes:
6
  - write-repos
7
+ hf_oauth_authorized_org: Deep-Fake
8
  pinned: false
9
  ---
10
 
index.html CHANGED
@@ -229,9 +229,15 @@ function push(now) {
229
  lastPush = Date.now();
230
  store.del(`t4:work:${name}`);
231
  } catch (e) {
232
- $("msg").textContent = String(e).includes("401")
233
- ? "⚠️ Sign-in expired: your work is kept in this browser. Reload the page and sign in again."
234
- : "⚠️ Could not save to HF (kept in this browser, will retry): " + e.message;
 
 
 
 
 
 
235
  } finally {
236
  pushing = null;
237
  syncLabel();
 
229
  lastPush = Date.now();
230
  store.del(`t4:work:${name}`);
231
  } catch (e) {
232
+ const text = String(e);
233
+ if (text.includes("401") || text.includes("not found")) {
234
+ // expired, or the sign-in did not grant the Deep-Fake org: sign in again (work stays in this browser)
235
+ store.del("t4:auth");
236
+ $("msg").innerHTML = '⚠️ Your sign-in cannot write to the dataset. Your work is kept in this browser. ' +
237
+ '<a href="" onclick="location.reload()">Reload and sign in again</a>, and allow access to the organization.';
238
+ } else {
239
+ $("msg").textContent = "⚠️ Could not save to HF (kept in this browser, will retry): " + e.message;
240
+ }
241
  } finally {
242
  pushing = null;
243
  syncLabel();