Can't setup local username/password with Surfsense
Not sure what i'm doing wrong, but i don't see any option anywhere to sign up or register. It just asks me to sign in with an email and password.
Hi @zono50 , You should be able to register at '/register' path. Many users get confused here I will add some info to this login page.
New user here. I am running into the same problem, but the "/register" path kicks me back to the "/login" path immediately. PgAdmin server was setup as per instruction, not sure what I am doing wrong.
New user here. I am running into the same problem, but the "/register" path kicks me back to the "/login" path immediately. PgAdmin server was setup as per instruction, not sure what I am doing wrong.
Make sure you have this .env as LOCAL : https://github.com/MODSetter/SurfSense/blob/fe0cabea72e557e85d066fcf1c936a091a39fb4b/surfsense_web/.env.example#L2
Oh thank you, it works now !
I got everything setup but when I try to register, I get this error:
(I used the "Register here" link to reach this page)
Okay, so the issue was (perhaps) that uvicorn hadn't started up yet. Now it works and I could register and login. However, I also changed the following from "localhost" to IP address of my docker host:
NEXT_PUBLIC_FASTAPI_BACKEND_URL
Backing up .env and docker-compose files now!
Okay, so the issue was (perhaps) that uvicorn hadn't started up yet. Now it works and I could register and login. However, I also changed the following from "localhost" to IP address of my docker host:
NEXT_PUBLIC_FASTAPI_BACKEND_URLBacking up
.envanddocker-composefiles now!
Thank you - just to confirm, I had to change this as well... I've been pulling my hair out for the past 2 hours on this, I appreciate development is difficult, but the logging and error reporting on this app is abysmal..
Set the NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL on root and frontend .env, but still when i want to go to /register it kicks me back to /login. In the backend i set AUTH_TYPE to LOCAL and REGISTATION_ENABLED = TRUE
@Acharab I also encountered the same issue. Do you know how to fix this?
@Yinnnn94 I did not, you could hash a password and add it in the DB, but that a little too mutch for me.
@Acharab @Yinnnn94 It should work after you set that var. If you are using docker make sure this var https://github.com/MODSetter/SurfSense/blob/57fd82f17f8ca21d8a65adfd10e300b705373d63/.env.example#L10 is also LOCAL
@MODSetter Hi, thanks for sharing this project! I was able to reach the registration page successfully. However, when I entered my email address and password, I got the following error message:
Login failed
An unexpected error occurred. Please try again
Here’s what I’ve tried so far:
- Changed localhost to the Docker host IP (as @kanwarplaha mentioned).
- Upgraded the image (following this issue).
Despite these changes, the error still persists. Do you have any idea how to fix this?
@MODSetter Umm, it suddenly worked — I was able to sign up successfully! 😅
I didn’t change anything else, so I’m not exactly sure what fixed it. Maybe the service just needed some time to start up properly.
Anyway, it’s working now — thanks for your help!
@MODSetter hey! I have the same issue, I made sure in all the .env files I got LOCAL and registration set to true. Still have all the issues above, I can't go to the /register endpoint as it redirects me to the login page. in the login page I see
Login failed
An unexpected error occurred. Please try again
Also, I saw the in the docker dashboard there's the backend image which is not starting as
exec /app/scripts/docker/entrypoint.sh: no such file or directory
even tho the entrypoint.sh file exists.
I have no clue what to do. Thanks in advance
@theDoz12 @projx @Acharab @Yinnnn94
The code checks process.env.NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE and defaults to "GOOGLE" if not found:
const authType = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE || "GOOGLE";
if (authType !== "LOCAL") {
router.push("/login");
}
The problem is that process.env in client-side Next.js code only contains environment variables that were available at build time, not at runtime. Even though the Docker container has NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL set, if the frontend was built before this variable was set, it won't be available.
To fix this, you need to rebuild the frontend container:
cd SurfSense
docker compose down
docker compose build
docker compose up -d
Same problem here... going to the registration URL bumps me back to login url. ; have tried all these steps (modified .env file, replaced localhost with container ip, rebuilt container) and still having the same problem
edit: rebuilt the container again and now it will stay on the registration page. However, it gives me "Login failed An unexpected error occurred. Please try again" on every attempt
same error here
Similar issues when I try to run Surfsense.
I think in general the application's parsing of the env vars seems a bit flaky, it doesn't seem to respect the environment variables that set the auth to LOCAL, it always seems to offer 'Continue with Google' and no local login issue, even after blowing everything away and starting fresh.
NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL
AUTH_TYPE=LOCAL
REGISTRATION_ENABLED=TRUE