jbilcke-hf HF staff commited on
Commit
59ef352
1 Parent(s): f021dad

I think we are nearly there

Browse files
Files changed (1) hide show
  1. src/app/state/useCurrentUser.ts +1 -5
src/app/state/useCurrentUser.ts CHANGED
@@ -119,8 +119,6 @@ export function useCurrentUser({
119
  main(isLoginRequired)
120
  }, [isLoginRequired, huggingfaceApiKey, huggingfaceTemporaryApiKey, userId])
121
 
122
-
123
-
124
  useEffect(() => {
125
 
126
  // DIY
@@ -154,6 +152,7 @@ export function useCurrentUser({
154
  if (res) {
155
  console.log("oauthHandleRedirectIfPresent returned something!", res)
156
  setOauthResult(res)
 
157
  setHuggingfaceTemporaryApiKey(res.accessToken)
158
  startTransition(async () => {
159
  console.log("TODO julian do something, eg. reload the page, remove the things in the URL etc")
@@ -170,9 +169,6 @@ export function useCurrentUser({
170
  }, [isLoginRequired])
171
 
172
 
173
-
174
-
175
-
176
  const login = async (
177
  // used to redirect the user back to the route they were browsing
178
  redirectTo: string = ""
 
119
  main(isLoginRequired)
120
  }, [isLoginRequired, huggingfaceApiKey, huggingfaceTemporaryApiKey, userId])
121
 
 
 
122
  useEffect(() => {
123
 
124
  // DIY
 
152
  if (res) {
153
  console.log("oauthHandleRedirectIfPresent returned something!", res)
154
  setOauthResult(res)
155
+ console.log("debug:", { accessToken: res.accessToken })
156
  setHuggingfaceTemporaryApiKey(res.accessToken)
157
  startTransition(async () => {
158
  console.log("TODO julian do something, eg. reload the page, remove the things in the URL etc")
 
169
  }, [isLoginRequired])
170
 
171
 
 
 
 
172
  const login = async (
173
  // used to redirect the user back to the route they were browsing
174
  redirectTo: string = ""