Giter Site home page Giter Site logo

saasykits / next-lucia-auth Goto Github PK

View Code? Open in Web Editor NEW
259.0 5.0 21.0 384 KB

This is a Next.js T3 project with authentication implemented using Lucia.

Home Page: https://next-lucia.vercel.app

License: MIT License

JavaScript 2.09% TypeScript 96.79% CSS 1.12%
lucia-auth nextjs-auth-example t3-stack trpc drizzle-auth nextjs-auth-reset nextjs-role-based-access-policy nextjs-user-verification trpc-with-lucia

next-lucia-auth's People

Contributors

edereagzi avatar fr3akymurk avatar iamtouha avatar jammy108 avatar kinfe123 avatar ryanleecode avatar sadmann7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

next-lucia-auth's Issues

Documentation: Hosting locally.

Greetings.
As you may already know, i have been battling with drizzle, mysql and planetscale, where most of the issues came from SSL errors.

I have found my solution to my problem.
I found out that planetscale uses HTTP / HTTPS to connect to instances, something planetscale supports but not something standard mysql servers do.

so this is my new index.ts file in drizzle that works.

import { drizzle } from "drizzle-orm/mysql2";
import mysql from 'mysql2';

// Create a MySQL connection pool (synchronous operation)

/*
Some options include:
    host: process.env["DATABASE_HOST"],
    user: process.env["DATABASE_USERNAME"],
    password: process.env["DATABASE_PASSWORD"],
    database: process.env["DATABASE_NAME"],
*/

import { env } from "@/env";
import * as schema from "./schema";

const pool = mysql.createPool({
    uri: 'mysql://root:MARIADB@localhost:3306/lucia',
    waitForConnections: true,
    connectionLimit: 10,
    queueLimit: 0
});

export const db = drizzle(pool, { schema, mode: "default" });

I do not care about the connection URI, it's local.

Passkeys Support

As security keeps expanding more and more, and improves more and more, we should take some steps to add more and more secure ways of signing in.

Therefore I recommend we look into passkeys, there is a way to implement it completely for free, but I forgot how to so some research will have to be done.

Server actions issues

Describe the bug
A clear and concise description of what the bug is
Error with the server actions used for auth in the template.

To Reproduce
Steps to reproduce the behavior:

  1. Go to auth page
  2. And try to login or sign up
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.
I am getting async await error await are supposed to be used in async functions I tried to find out the issues but I think it is directly from the functions itself

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Browser [e.g. chrome, edge, brave ]

More post features.

Some more post features would be nice, such as publishing (to make it visible to others) and viewing published posts from other users, this should be relatively simple.

It would be pretty neat if you or someone else on would contribute to the repository to add the capabilities of publishing posts and viewing posts, not to be confused with editing posts.

I am looking into the idea of creating a way to view posts by modifying the editor, removing the capability of editing the post and rather view it by using slugs.

I am also looking into using the "/account" page as a template for all the published posts.

Todo:

  • Create a page to view published posts.
  • Add a feature to publish posts. (status can be used to post.)

Redirect too fast for form to handle. (Register page)

Describe the bug
The form gets redirected as soon as possible (100ms that i saw) (This was code for the editor, not sign in.) which is way too soon for the db to even get a request and thus you get redirected without your account being created.
This seems to only affect users like me who do not use planetscale but for best practices it could be a great idea to implement a more stable fix.

To Reproduce

  • Get my code from #40 and configure a local mysql server.
  • Run db:push
  • Go to sign up page and register.

Expected behavior
An account being created before you get redirected, or alternatively sign the user in immediately after creating the account.

Screenshots
Not applicable, a video would be more suitable for this type of issue.

SSL wrong version number.

Greetings,
I have an issue on my local build for development where i cannot get the application to properly connect to the DB because of a SSL issue.

I keep getting this issue at:

 ⨯ TypeError: fetch failed
    at async login (./src/lib/auth/actions.ts:64:26)
Cause: [Error: 00F88DA8327F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:
] {
  library: 'SSL routines',
  reason: 'wrong version number',
  code: 'ERR_SSL_WRONG_VERSION_NUMBER'
}

Problem is, this is a completely fresh clone from github, the .env is the only edited part.
How can i solve this error?

Warning: You need to pass an instance of Client

Describe the bug

Warning: You need to pass an instance of Client:

import { Client } from "@planetscale/database";

const client = new Client({
  host: process.env["DATABASE_HOST"],
  username: process.env["DATABASE_USERNAME"],
  password: process.env["DATABASE_PASSWORD"],
});

const db = drizzle(client);

Starting from version 0.30.0, you will encounter an error if you attempt to use anything other than a Client instance.
Please make the necessary changes now to prevent any runtime errors in the future

To Reproduce
Steps to reproduce the behavior:

  1. Run 'pnpm dev'
  2. See logs on terminal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.