Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/bun/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { handlers, api } from "./auth"
import { handlers, api } from "@/lib/auth"

Bun.serve({
port: 3000,
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions apps/bun/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"extends": "@aura-stack/tsconfig/bun.json",
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["dist", "node_modules"]
}
2 changes: 1 addition & 1 deletion apps/elysia/src/plugins/with-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const withAuthPlugin = new Elysia({ name: "with-auth" })
const session = await api.getSession({
headers: ctx.request.headers,
})
if (!session!.authenticated) {
if (!session.authenticated) {
return { session: null }
}
return { session }
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/app-router/src/@types/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { authClient } from "@/lib/client"
import type { authClient } from "@/lib/auth-client"
import type { Session } from "@aura-stack/auth"

export interface AuthContextValue {
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/app-router/src/app/api/auth/[...aura]/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { handlers } from "@/auth"
import { handlers } from "@/lib/auth"

export const { GET, POST } = handlers
export const { GET, POST, PATCH } = handlers
14 changes: 12 additions & 2 deletions apps/nextjs/app-router/src/contexts/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import { createContext, use, useState, useEffect } from "react"
import { authClient } from "@/lib/client"
import { authClient } from "@/lib/auth-client"
import type { Session, LiteralUnion, BuiltInOAuthProvider, SignInOptions, SignOutOptions } from "@aura-stack/auth"
import type { AuthContextValue } from "@/@types/types"
import type { AuthProviderProps } from "@/@types/props"
Expand Down Expand Up @@ -53,7 +53,17 @@ export const AuthProvider = ({ children, session: defaultSession }: AuthProvider
}, [defaultSession])

return (
<AuthContext value={{ session, isAuthenticated, isLoading, signIn, signOut } as AuthContextValue}>{children}</AuthContext>
<AuthContext
value={{
session,
isAuthenticated,
isLoading,
signIn,
signOut,
}}
>
{children}
</AuthContext>
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type AuthInstance, createAuth } from "@aura-stack/auth"
import { createAuth } from "@aura-stack/auth"
import { builtInOAuthProviders, type BuiltInOAuthProvider } from "@aura-stack/auth/oauth/index"

export const oauth = Object.keys(builtInOAuthProviders) as BuiltInOAuthProvider[]
export const providers = [builtInOAuthProviders.github(), builtInOAuthProviders.gitlab(), builtInOAuthProviders.bitbucket()]

export const { handlers, jose, api }: AuthInstance = createAuth({
export const { handlers, jose, api } = createAuth({
oauth,
basePath: "/api/auth",
trustedProxyHeaders: true,
baseURL: "http://localhost:3000",
})
2 changes: 1 addition & 1 deletion apps/nextjs/app-router/src/lib/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use server"

import { api } from "@/auth"
import { api } from "@/lib/auth"
import { redirect } from "next/navigation"
import { cookies, headers } from "next/headers"
import { isRedirectError } from "next/dist/client/components/redirect-error"
Expand Down
4 changes: 2 additions & 2 deletions apps/nuxt/shared/auth.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type AuthInstance, createAuth } from "@aura-stack/auth"
import { createAuth } from "@aura-stack/auth"
import { builtInOAuthProviders, type BuiltInOAuthProvider } from "@aura-stack/auth/oauth/index"

export const oauth = Object.keys(builtInOAuthProviders) as BuiltInOAuthProvider[]

export const { handlers, jose }: AuthInstance = createAuth({
export const { handlers, jose } = createAuth({
oauth,
basePath: "/api/auth",
trustedProxyHeaders: true,
Expand Down
3 changes: 3 additions & 0 deletions apps/tanstack-start/src/routes/api/auth.$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export const Route = createFileRoute("/api/auth/$")({
POST: async ({ request }) => {
return await handlers.POST(request)
},
PATCH: async ({ request }) => {
return await handlers.PATCH(request)
},
},
},
})
5 changes: 5 additions & 0 deletions apps/vercel/api/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import { handlers } from "../_auth.js"

export const GET = async (request: Request) => {
Expand All @@ -7,3 +8,7 @@ export const GET = async (request: Request) => {
export const POST = async (request: Request) => {
return await handlers.POST(request)
}

export const PATCH = async (request: Request) => {
return await handlers.PATCH(request)
}
28 changes: 12 additions & 16 deletions docs/src/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
@import "fumadocs-ui/css/preset.css";

@theme {
--foreground: oklch(0.985 0 0);
--color-primary: oklch(0.97 0 0);
--color-primary-foreground: oklch(0.6 0.01 286.11);
--color-border: color-mix(in oklab, var(--color-white) 20%, transparent);
--breakpoint-base: 56.25rem;
--color-background: #000000;
--color-muted-foreground: color-mix(
in oklab,
var(--color-white) 60%,
transparent
);
--breakpoint-xs: 540px;
--radius-2xl: 0rem;
--radius-xl: 0rem;
--radius-lg: 0rem;
--radius-md: 0rem;
--foreground: oklch(0.985 0 0);
--color-primary: oklch(0.97 0 0);
--color-primary-foreground: oklch(0.6 0.01 286.11);
--color-border: color-mix(in oklab, var(--color-white) 20%, transparent);
--breakpoint-base: 56.25rem;
--color-background: #000000;
--color-muted-foreground: color-mix(in oklab, var(--color-white) 60%, transparent);
--breakpoint-xs: 540px;
--radius-2xl: 0rem;
--radius-xl: 0rem;
--radius-lg: 0rem;
--radius-md: 0rem;
}
Loading
Loading