Adonis Session #4544
-
I'm creating a session, and following the directions from the documentation.. but why is it like this. LoginContoller: import User from "#models/user";
async submitForm(ctx: HttpContext) {
let email = ctx.request.input("email");
let password = ctx.request.input("password");
const user = await User.verifyCredentials(email, password);
await ctx.auth.use("web").login(user); // <-- Error
return ctx.response.redirect().toRoute("dashboard_core.index");
} Config/auth: const authConfig = defineConfig({
default: "web",
guards: {
web: sessionGuard({
useRememberMeTokens: false,
provider: sessionUserProvider({
model: () => import("#models/user"),
}),
}),
},
}); User verify credentials: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This error occurs after I clear the cookie that binds the session |
Beta Was this translation helpful? Give feedback.
-
When I stopped the server and changed to another port or use |
Beta Was this translation helpful? Give feedback.
-
The issue comes in HMR mode and we can reproduce it. Will come back with more information soon. |
Beta Was this translation helpful? Give feedback.
-
That was indeed a problem with Hot Hook. Please updgrade to |
Beta Was this translation helpful? Give feedback.
That was indeed a problem with Hot Hook. Please updgrade to
hot-hook@0.2.2
and the problem should be fixed. Let me know if it's ok for you