KwozyK
KwozyK
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
Solution was using bearer plugin and making sure my auth server was actually hosted to the network. for future reference if anyone needs
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
thanks for all the help
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
K so im an idiot and that was why. now it is working. .
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
get the same undefined:undefined error. it almost seems as if the server is never being hit even though the server IP address never changes? could this be because the server is running on a local host? now that i think about it that does kinda make sense, still weird that i can access it while --host is configured but on the same computer
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
still doesnt work when running the preview either, while accessing from the same computer but hosted
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
using the bearer plugin
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
const { error } = await authClient.signIn.email({
email,
password: password,
callbackURL: "/",
}, {
onSuccess(context) {
const authToken = context.response.headers.get("set-auth-token") // get the token from the response headers
// Store the token securely (e.g., in localStorage)
if (authToken) {
setError(authToken);
localStorage.setItem("bearer_token", authToken);
}
},
});
if (error) { setError(error.message! + ":" + error.code! + ":" + error.statusText) }
};
const { error } = await authClient.signIn.email({
email,
password: password,
callbackURL: "/",
}, {
onSuccess(context) {
const authToken = context.response.headers.get("set-auth-token") // get the token from the response headers
// Store the token securely (e.g., in localStorage)
if (authToken) {
setError(authToken);
localStorage.setItem("bearer_token", authToken);
}
},
});
if (error) { setError(error.message! + ":" + error.code! + ":" + error.statusText) }
};
my login logic
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
the undefined:undefined is the error i get back from the error object on sign in. not too useful. also it doesnt hit the on success method either as i tried to set that div text to the authToken and it just displayed the error
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
No description
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
hi. Thanks for the info. I have set up the bearer plugin and now it is working when i host it and access it from my computer (using the ip, but still the same cimputer the server is running on). When i try my phone (safari or google chrome on IOS) it doesn't work still.
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
More context: testing building the app and running the preview locally and it has the same effect as if i were on the phone when its hosted in dev
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
Adding more context: what happens above is when hosting it but still accessing it from my computer (what the server is running on) using the ip and not local host. When accessing it from my phone it doesnt do anything, that is it does not reach the auth server, does not attempt the redirect but when i display the error all values are undefined (the message, the code, the status text) the status is 0
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
seesion not saving when running dev server with --host or when running build
ran out of characters. But wanted to say that any help would be appraciated greatly
16 replies
BABetter Auth
Created by KwozyK on 2/18/2025 in #help
Validate Client Side Auth On Server
Thanks wasn’t sure just wanted to confirm. Appreciate it
5 replies