Spaces:
Sleeping
Sleeping
Julian Bilcke
commited on
Commit
·
6365220
1
Parent(s):
59ef352
damn
Browse files
src/app/state/useCurrentUser.ts
CHANGED
|
@@ -56,10 +56,14 @@ export function useCurrentUser({
|
|
| 56 |
const checkSession = async (isLoginRequired: boolean = false): Promise<UserInfo | undefined> => {
|
| 57 |
|
| 58 |
console.log("useCurrentUser.checkSession()")
|
|
|
|
|
|
|
| 59 |
// new way: try to use the safer temporary key whenever possible
|
| 60 |
if (huggingfaceTemporaryApiKey) {
|
| 61 |
try {
|
| 62 |
|
|
|
|
|
|
|
| 63 |
const user = await getCurrentUser(huggingfaceTemporaryApiKey)
|
| 64 |
|
| 65 |
setCurrentUser(user)
|
|
|
|
| 56 |
const checkSession = async (isLoginRequired: boolean = false): Promise<UserInfo | undefined> => {
|
| 57 |
|
| 58 |
console.log("useCurrentUser.checkSession()")
|
| 59 |
+
const huggingfaceTemporaryApiKey = localStorage.getItem(localStorageKeys.huggingfaceTemporaryApiKey) || ""
|
| 60 |
+
console.log("huggingfaceTemporaryApiKey:", huggingfaceTemporaryApiKey)
|
| 61 |
// new way: try to use the safer temporary key whenever possible
|
| 62 |
if (huggingfaceTemporaryApiKey) {
|
| 63 |
try {
|
| 64 |
|
| 65 |
+
console.log(`calling getCurrentUser()`, { huggingfaceTemporaryApiKey })
|
| 66 |
+
|
| 67 |
const user = await getCurrentUser(huggingfaceTemporaryApiKey)
|
| 68 |
|
| 69 |
setCurrentUser(user)
|