Skip to content

Commit

Permalink
feat: google-auth-endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ap0nia committed Nov 16, 2023
1 parent 177432e commit 0ae2b0a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 22 deletions.
1 change: 1 addition & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"websoc-api": "^3.0.0"
},
"devDependencies": {
"@auth/core": "^0.18.1",
"@aws-sdk/client-dynamodb": "^3.332.0",
"@aws-sdk/lib-dynamodb": "^3.332.0",
"@types/aws-lambda": "^8.10.110",
Expand Down
12 changes: 12 additions & 0 deletions apps/backend/src/routers/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { GoogleProfile } from '@auth/core/providers/google';

import { router, procedure } from '../trpc';

export const authRouter = router({
login: procedure
.input((rawInput) => rawInput as GoogleProfile)
.mutation(async (opts) => {
const user = opts.input;
console.log({ user });
}),
});
2 changes: 2 additions & 0 deletions apps/backend/src/routers/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { router } from '../trpc';
import { authRouter } from './auth';
import newsRouter from './news';
import usersRouter from './users';
import zotcourseRouter from "./zotcours";

const appRouter = router({
auth: authRouter,
news: newsRouter,
users: usersRouter,
zotcourse: zotcourseRouter
Expand Down
91 changes: 69 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ae2b0a

Please sign in to comment.