generated from namidapoo/next15-shadcn-use-bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from namidapoo/feat/auth
feat: 認証実装
- Loading branch information
Showing
12 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
AUTH_SECRET= | ||
AUTH_GITHUB_ID= | ||
AUTH_GITHUB_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: バグレポート | ||
about: レポートを作成して改善に役立てる | ||
title: "[BUG] バグの内容" | ||
labels: bug | ||
assignees: "" | ||
--- | ||
|
||
## バグの内容 <!-- バグの内容を明確かつ簡潔に説明してください。--> | ||
|
||
## 再現方法 <!-- 動作を再現するための手順 --> | ||
|
||
1. | ||
2. | ||
|
||
## 想定動作 <!-- 想定する動作を明確かつ簡潔に説明してください。 --> | ||
|
||
## スクリーンショット <!-- 問題を説明するためにスクリーンショットを追加してください。--> | ||
|
||
## 補足 <!-- 補足があれば、記述してください。 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: 機能要望 | ||
about: プロジェクトに機能を要望する | ||
title: "[FEATURE] 機能名" | ||
labels: feature | ||
assignees: "" | ||
--- | ||
|
||
## 機能の説明 <!-- 実現したいことを明確かつ簡潔に説明してください。 --> | ||
|
||
```[tasklist] | ||
## Story | ||
``` | ||
|
||
## 背景 <!-- この機能を追加する背景(ユーザーにどういうメリットが有るか)を明確かつ簡潔に説明してください。 --> | ||
|
||
## 課題・検討・補足 <!-- 補足があれば、記入してください。 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: ストーリー | ||
about: ユーザーストーリー | ||
title: "[STORY] 〜をする、〜をしたい" | ||
labels: story | ||
assignees: "" | ||
--- | ||
|
||
## ストーリーの目的 <!-- このストーリーによってユーザーが得られる価値はなんでしょうか --> | ||
|
||
## 経緯・背景 <!-- このストーリーが作られた経緯があれば記載します --> | ||
|
||
## 実現方法/UI <!-- このストーリーを実現するための方法、UI はなんでしょうか --> | ||
|
||
## 受入条件・完了の定義 <!-- ストーリーが達成されたことを確認する条件を箇条書きします --> | ||
|
||
## 詳細タスク | ||
|
||
```[tasklist] | ||
### 調査 | ||
``` | ||
|
||
```[tasklist] | ||
### 設計 | ||
``` | ||
|
||
```[tasklist] | ||
### フロント実装 | ||
``` | ||
|
||
```[tasklist] | ||
### バックエンド実装 | ||
``` | ||
|
||
```[tasklist] | ||
### テスト | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: タスク | ||
about: タスクを作成する | ||
title: "[TASK] タスク内容" | ||
labels: "" | ||
assignees: "" | ||
--- | ||
|
||
## タスク <!-- タスク内容を明確かつ簡潔に説明してください。 --> | ||
|
||
## 資料 <!-- 資料があれば、追加してください。 --> | ||
|
||
## 作業 <!-- 作業内容を箇条書きで記述しください。 --> | ||
|
||
```[tasklist] | ||
### tasks | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## issue <!-- #issue番号を記載してください --> | ||
|
||
## 変更内容 <!-- 行った変更を簡略に記載してください --> | ||
|
||
## 確認したこと <!-- 何を以て変更要件を満たしていると判断したかを記載してください --> | ||
|
||
## スクリーンショット <!-- 変更がわかる画面があれば記載してください --> | ||
|
||
## 補足事項 <!-- 補足で説明が必要な場合記載してください --> | ||
|
||
## PR 時のセルフチェック <!-- PRのセルフチェックをしてください --> | ||
|
||
- [ ] 関数や変数の命名は一目で分かるものになってますか? | ||
- [ ] コメントは適切な量で、誰が見ても分かるコメントになってますか? | ||
- [ ] PR 内容に関するテストは書きましたか? | ||
- [ ] Issue の完了の定義は満たせていますか? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { handlers } from "@/lib/auth"; | ||
|
||
export const runtime = "edge"; | ||
export const { GET, POST } = handlers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import NextAuth from "next-auth"; | ||
import GitHub from "next-auth/providers/github"; | ||
export const { handlers, auth, signIn, signOut } = NextAuth({ | ||
providers: [GitHub], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { auth } from "@/lib/auth"; | ||
import { type NextRequest, NextResponse } from "next/server"; | ||
|
||
export async function middleware(req: NextRequest) { | ||
const session = await auth(); | ||
if (!session) { | ||
return NextResponse.redirect(new URL("/api/auth/signin", req.url)); | ||
} | ||
return NextResponse.next(); | ||
} | ||
|
||
export const config = { | ||
matcher: ["/((?!api|_next/static|_next/image|favicon.ico).*)"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters