![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@fluido/dreno-nextjs
Advanced tools
Dreno is one of the easiest way to add authentication and user management to your Next.js application. Add sign up, sign in, and profile management to your application in minutes.
npm install @fluido/dreno-nextjs
To build the package locally with the TypeScript compiler, run:
npm run build
To build the package in watch mode, run the following:
npm run dev
Dreno only requires your application to export a middleware
.
DRENO_KEY
Get your DRENO_KEY
at dreno.fluido.design.
Set DRENO_KEY
to your .env.local
file.
DRENO_KEY=[projectId]:•••••••••••
middleware.ts
At the root of your Next.js project, create a file named middleware.ts
like the following:
import { drenoMiddleware } from '@fluido/dreno-nextjs/server'
export const middleware = drenoMiddleware()
export const config = {
matcher: [
/*
* Standard Next.js matcher config.
* Read more at Next's Documentation:
* https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths
*
*/
'/((?!api|_next/static|_next/image|favicon.ico).*)',
],
}
With async Server Components the getAuth
function returns a Promise that you can await to get auth info.
import { getAuth } from '@fluido/dreno-nextjs/server'
import { notFound } from 'next/navigation'
export default async function Page() {
const auth = await getAuth()
if (!auth.isAuthorized) notFound()
return <h1>Hello {auth.user.name}!</h1>
}
With Client Components the useAuth
hook returns an auth info object.
'use client'
import { useAuth } from '@fluido/dreno-nextjs'
export function LogoutButton() {
const auth = useAuth()
return <button onClick={() => auth?.logout()}>Logout</button>
}
This is a bare minimum example that protects every route of your app. When trying to access any route, the visitor will be redirected to a custom domain provided by Fluido.
For further details on how to create your own login roudes, examples, and more, please refer to our Documentation.
You can get in touch with us in any of the following ways:
We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines.
@fluido/dreno-nextjs
follows good practices of security, but 100% security cannot be assured.
@fluido/dreno-nextjs
is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.
FAQs
Dreno library
The npm package @fluido/dreno-nextjs receives a total of 5 weekly downloads. As such, @fluido/dreno-nextjs popularity was classified as not popular.
We found that @fluido/dreno-nextjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.