
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
A comprehensive and customizable authentication solution for applications. Includes flexible auth flows, email/SMS verification, custom middleware, and integration with Twilio and SMTP services.
The NPM repo is available here - https://www.npmjs.com/package/goobs-auth
goobs-auth is a comprehensive authentication solution for Next.js applications. It provides a flexible and customizable authentication flow that can be easily integrated into your projects.
To install goobs-auth in your Next.js project, run one of the following commands:
npm install goobs-auth
# or
yarn add goobs-auth
next.config.js
:/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
transpilePackages: ['goobs-frontend', 'goobs-cache', 'goobs-auth', 'goobs-encryption'],
};
export default nextConfig;
.auth.json
) in your project root:{
"userModel": {
"getUser": {
"path": "./path/to/getUserFunction",
"exportName": "getUser"
},
"setUser": {
"path": "./path/to/setUserFunction",
"exportName": "setUser"
},
"deleteUser": {
"path": "./path/to/deleteUserFunction",
"exportName": "deleteUser"
}
},
"database": {
"connectScript": "// Your database connection script"
},
"authentication": {
"login": [
{ "step": 1, "type": "enterEmail" },
{ "step": 2, "type": "emailAndPasswordVerification" }
],
"registration": [
{ "step": 1, "type": "enterEmail" },
{ "step": 2, "type": "emailAndPasswordAndVerifyPasswordVerification" },
{ "step": 3, "type": "emailVerification" },
{ "step": 4, "type": "textMessageVerification" },
{ "step": 5, "type": "accountInfo" }
],
"forgotPassword": [
{ "step": 1, "type": "enterEmail" },
{ "step": 2, "type": "emailVerification" }
]
},
"twilio": {
"accountSid": "your_twilio_account_sid",
"authToken": "your_twilio_auth_token",
"phoneNumber": "your_twilio_phone_number"
},
"smtp": {
"host": "your_smtp_host",
"port": 587,
"secure": false,
"auth": {
"user": "your_smtp_username",
"pass": "your_smtp_password"
},
"from": "noreply@yourdomain.com"
}
}
// pages/auth.tsx
'use client';
import React from 'react';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
import { AuthPageContent } from 'goobs-auth';
export default function AuthPage() {
return (
<AppRouterCacheProvider>
<AuthPageContent />
</AppRouterCacheProvider>
);
}
authMiddleware
:// middleware.ts
import { authMiddleware } from 'goobs-auth';
export default authMiddleware;
The .auth.json
file allows you to customize various aspects of the authentication flow:
userModel
: Define functions for user management (get, set, delete)database
: Specify the database connection scriptauthentication
: Configure the steps for login, registration, and password recoverytwilio
: Set up Twilio credentials for SMS servicessmtp
: Configure SMTP settings for email servicesloadAuthConfig(configPath?: string): Promise<AuthConfig>
Loads the authentication configuration from the specified path or the default locations.
authUtility(options: AuthUtilityOptions): Promise<ValidateResult | LoginResult | LogoutResult>
A comprehensive authentication utility for server components and server actions.
authSpoof(options?: AuthSpoofOptions): Promise<{ isValid: boolean, validTokens: ValidTokens }>
Generates mock authentication data for testing purposes.
goobs-auth provides several React components for building the authentication UI:
AuthPageContent
: The main authentication page componentEnterEmailStep
: Component for entering emailEmailPasswordVerificationStep
: Component for email and password verificationEmailVerificationStep
: Component for email verificationTextMessageVerificationStep
: Component for SMS verificationAccountInfoStep
: Component for collecting additional account informationgoobs-auth includes several server-side actions for handling authentication:
verifyEmail
: Verifies an email addresssendEmail
: Sends an email (e.g., for verification)sendSMS
: Sends an SMS messageverifyUser
: Verifies a user's phone numberThe authMiddleware
function can be used to protect routes and validate authentication tokens.
This project is licensed under the MIT License.
For questions, feature requests, or support, please contact:
For the quickest response, please use email. Our website is currently under development and will be shared here soon.
FAQs
A comprehensive and customizable authentication solution for applications. Includes flexible auth flows, email/SMS verification, custom middleware, and integration with Twilio and SMTP services.
The npm package goobs-auth receives a total of 1 weekly downloads. As such, goobs-auth popularity was classified as not popular.
We found that goobs-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.