
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
@solid-auth/next
Advanced tools
This is a SolidStart implementation of next-auth.
Recommended to use create-jd-app
npm install @solid-auth/next@latest @auth/core@latest
Generate auth secret, then set it as an environment variable:
AUTH_SECRET=your_auth_secret
Don't forget to trust the host.
AUTH_TRUST_HOST=true
in this example we are using github so make sure to set the following environment variables:
GITHUB_ID=your_github_oatuh_id
GITHUB_SECRET=your_github_oatuh_secret
// routes/api/auth/[...solidauth].ts
import { SolidAuth, type SolidAuthConfig } from "@solid-auth/next";
import GitHub from "@auth/core/providers/github";
import { type APIEvent } from "solid-start";
export const authOpts: SolidAuthConfig = {
providers: [
GitHub({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
debug: false,
};
export const { GET, POST } = SolidAuth(authOpts);
import { signIn, signOut } from "@solid-auth/next/client";
const login = () => signIn("github");
const logout = () => signOut();
import { getSession } from "@solid-auth/next";
import { createServerData$ } from "solid-start/server";
import { authOpts } from "~/routes/api/auth/[...solidauth]";
export const useSession = () => {
return createServerData$(
async (_, { request }) => {
return await getSession(request, authOpts);
},
{ key: () => ["auth_user"] }
);
};
// useSession returns a resource:
const session = useSession();
const loading = session.loading;
const user = () => session()?.user;
FAQs
Authentication for SolidStart.
The npm package @solid-auth/next receives a total of 4 weekly downloads. As such, @solid-auth/next popularity was classified as not popular.
We found that @solid-auth/next demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.