Skip to content

Instantly share code, notes, and snippets.

@ariannargesi
ariannargesi / route.ts
Created October 1, 2023 08:35
route.ts
import { login } from "@/api/authentication";
import NextAuth from "next-auth/next";
import CredentialsProvider from "next-auth/providers/credentials";
import GoogleProvider from "next-auth/providers/google";
import LinkedInProvider, { LinkedInProfile } from "next-auth/providers/linkedin";
import { signIn } from "next-auth/react";
const handler = NextAuth({
debug: false,
@ariannargesi
ariannargesi / middleware.js
Created June 1, 2023 12:46
Protect api routes and pages using next.js middleware file
import { NextMiddleware, NextResponse } from "next/server";
const publicPages = ['/', '/login', '/signup']
export const middleware: NextMiddleware = async (req) => {
const sessionToken = req.cookies.get('next-auth.session-token')
if (req.nextUrl.pathname.startsWith("/_next"))
return NextResponse.next();
@ariannargesi
ariannargesi / SQL Server commands and queries.md
Created January 24, 2022 08:35 — forked from ashish2199/SQL Server commands and queries.md
List of Microsoft SQL Server queries and commands

To create a Table

	create table risk_clos_rank(
		id_num int IDENTITY(1,1) NOT NULL,
	    username nvarchar(100),
	    datetime_of_decision DATETIME
	);
	
	CREATE TABLE TheNameOfYourTable (
 ID INT NOT NULL IDENTITY(1,1),
@ariannargesi
ariannargesi / index.html
Created September 8, 2020 13:18
The prismatic forms
<ul class="nav">
<li onclick="showLogin()">Login</li>
<li onclick="showSignup()">Sign up</li>
<li onclick="showForgotPassword()">Forgot password</li>
<li onclick="showSubscribe()">Subscribe</li>
<li onclick="showContactUs()">Contact us</li>
</ul>
<div class="wrapper">
<div class="rec-prism">
<div class="face face-top">