Skip to content

Commit

Permalink
feat(examples): Add M2M auth with Next.js
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Apr 7, 2024
1 parent df4dbb0 commit 82f398c
Show file tree
Hide file tree
Showing 14 changed files with 5,115 additions and 2 deletions.
3 changes: 1 addition & 2 deletions docs/malta.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"title": "Design",
"pages": [
["Next.js SDK", "/design/sdk"],
["Components", "/design/components"],
["Backend", "/design/backend"]
["Components", "/design/components"]
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions examples/m2m-auth-with-next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions examples/m2m-auth-with-next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
3 changes: 3 additions & 0 deletions examples/m2m-auth-with-next/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# M2M Auth with Next.js

This app aims to exemplify the use case of an M2M auth with SaaS application built with Next.js, in which customers call it's API endpoints built as route handlers.
20 changes: 20 additions & 0 deletions examples/m2m-auth-with-next/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "M2M auth with Next",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
);
}
7 changes: 7 additions & 0 deletions examples/m2m-auth-with-next/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function Home() {
return (
<main>
<h1>Hello World</h1>
</main>
);
}
4 changes: 4 additions & 0 deletions examples/m2m-auth-with-next/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
Loading

0 comments on commit 82f398c

Please sign in to comment.