#Authjs QwikJS Plugin: How to use own ui for E-Mail authentication?

3 messages · Page 1 of 1 (latest)

spiral mantle
#

Hey there, actually im using qwikjs plugin authjs to handle my socials logins and all the stuff.
Now I want to implement the E-Mail registration. When I start the register stuff Im getting redirectetd to the unbranded page. But I dont want to fpr the email stuff. I want to stay in my register form. You know how to do?

this is my Form:

 const signInSig = useSignIn();
 <Form action={signInSig}>
  <div>
    //my fields....
  <button type="submit">
    Weiter
  </button>
</Form>

this is my [email protected]:

export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
  ({ env }) => {
    return {
      secret: env.get("AUTH_SECRET"),
      trustHost: true,
      debug: true,
      providers: [
        ...
        Credentials({
          credentials: {
            email: { label: "Email" },
            password: { label: "Password", type: "password" },
          },
          async authorize(credentials) {
            const { email, password } =
              await signInSchema.parseAsync(credentials);
            //datatbase handling....
          },
        }),
      ],
    };
  },
);
steep birch
#

as shown here i think u should add 1 more parameter which is "callback" to your login handler

Callbacks are asynchronous functions you can use to control what happens when an action is performed.

#

i advise u to check auth.js docs instead of qwik's