saasykits / next-lucia-auth Goto Github PK
View Code? Open in Web Editor NEWThis is a Next.js T3 project with authentication implemented using Lucia.
Home Page: https://next-lucia.vercel.app
License: MIT License
This is a Next.js T3 project with authentication implemented using Lucia.
Home Page: https://next-lucia.vercel.app
License: MIT License
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.
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.
We need to have a google or github oauth providers by default to be inclusive for mass demands
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:
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):
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:
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
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.
Awesome template, small nit to use "Next.js" everywhere here 😄
SHould I add my unprotected routes in the matcher in middleware.ts ?
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?
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.