Skip to content

cold-world/nextjs-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js blog.

Next.js with Typescript, Firebase database and Next auth.

Main goal -> build fullstack app.

Features ->

  1. Auth/login.
  2. Send message without login.
  3. Create a post with login.

Alt Text Alt Text Alt Text


A piece of code

import { hash, compare } from 'bcryptjs';
import { User } from '../pages/api/auth/signup';

export const hashPassword = async (password: string) => {
  const hashedPassword = await hash(password, 12);
  return hashedPassword;
};

export const signUpHelper = async (user: User) => {
  await fetch('/api/auth/signup', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(user),
  });
};

export const verifyPassword = async (password: string, hashedPassword: string) => {
  const isValid = await compare(password, hashedPassword);
  return isValid;
};

Download & Installation

git clone https://github.com/cold-world/nextjs-blog.git
cd <project-dir>
npm install
npm run dev

About

Blog with auth. Next js, Typescript, Firebase database and Next auth

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors