authenticationqwik

Custom Login Page in Qwik with Qwik-auth plugin


Qwik has a built in plugin for AuthJS called qwik auth (which as far as I am aware is undocumented). I’m not having any issue with it except that I want a custom login page (I want my form to authenticate the user instead of the default ugly form on /api/auth/signin) but I cannot figure out how to do this. Because there are no official docs, I’m not sure what to do. Do I need to make a POST request to some api built into Qwik? Is there a function I can call? If it helps, this is essentially what my code looks like: https://github.com/gilf/qwik-auth-example


Solution

  • Doing a traditional html form post as described at https://next-auth.js.org/configuration/pages#credentials-sign-in will work. You can get a csrf token from /api/auth/csrf.