SSlime-s / authjs-traq-sample

Home Page:https://authjs-traq-sample.trap.show/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://wiki.trap.jp/document/r/最速 traQ OAuth セットアップ (with Next.js & Auth.js)

のサンプルリポジトリです

NeoShowcase を用いて https://authjs-traq-sample.trap.show にデプロイされています

ディレクトリ説明

src
├── app
│   ├── api/auth/[...nextauth]/route.ts
│   |     Auth.js で使用する API ルート
|   |
│   ├── page.tsx
│   |     色々つめこんだサンプル
|   |
|   ├── latestMessage/page.tsx
|   │     最新のメッセージを表示するだけのページ
|   |     アクセストークンの取得及び利用のサンプル
|   |
|   ├── signIn/page.tsx
|   |     サインインのサンプル
|   |
|   └── whoami/page.tsx
|         サインインしているユーザーの情報を表示するページ
|         ユーザー情報の取得のサンプル
|
├── features/auth
|   | Auth.js の設定関連をまとめたディレクトリ
|   |
|   ├── index.ts
|   |     基本的にここで export したものを他のファイルから import して使う
|   |
|   ├── traqProvider.ts
|   |     traQ 用の provider を定義
|   |
|   └── options.ts
|         NextAuth に渡す設定を定義
|
└── types/auth.d.ts
      accessToken を追加した User 型を定義

ページ説明

Getting Started

First, run the development server:

pnpm dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

https://authjs-traq-sample.trap.show/

License:MIT License


Languages

Language:TypeScript 85.7%Language:CSS 10.4%Language:JavaScript 3.9%