Spaces:
Sleeping
Sleeping
Julian Bilcke
commited on
Commit
·
e72595d
1
Parent(s):
b48537f
add the login button
Browse files
src/app/interface/login/login.tsx
CHANGED
|
@@ -6,27 +6,8 @@ import { Button } from "@/components/ui/button"
|
|
| 6 |
import { useOAuth } from "@/lib/useOAuth"
|
| 7 |
|
| 8 |
function Login() {
|
| 9 |
-
const {
|
| 10 |
-
|
| 11 |
-
useEffect(() => {
|
| 12 |
-
if (!oauthResult) {
|
| 13 |
-
return
|
| 14 |
-
}
|
| 15 |
-
|
| 16 |
-
const { userInfo } = oauthResult
|
| 17 |
-
|
| 18 |
-
// TODO use the Inference API
|
| 19 |
-
|
| 20 |
-
if (userInfo.isPro) {
|
| 21 |
-
// TODO we could do something with the fact the user is PRO versus other types of users
|
| 22 |
-
}
|
| 23 |
-
}, [canLogin, isLoggedIn, oauthResult])
|
| 24 |
-
|
| 25 |
-
if (isLoggedIn || canLogin) {
|
| 26 |
-
return <Button onClick={login}>Sign-in with Hugging Face</Button>
|
| 27 |
-
} else {
|
| 28 |
-
return null
|
| 29 |
-
}
|
| 30 |
}
|
| 31 |
|
| 32 |
export default Login
|
|
|
|
| 6 |
import { useOAuth } from "@/lib/useOAuth"
|
| 7 |
|
| 8 |
function Login() {
|
| 9 |
+
const { login } = useOAuth({ debug: false })
|
| 10 |
+
return <Button onClick={login}>Sign-in with Hugging Face</Button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
}
|
| 12 |
|
| 13 |
export default Login
|