Skip to content

Commit

Permalink
feat(deps): bump nuxt-auth-utils and use his password hasing by default
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienZ committed Oct 1, 2024
1 parent af813e2 commit f943075
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"eslint": "^9.10.0",
"hookable": "^5.5.3",
"nuxt": "^3.13.2",
"nuxt-auth-utils": "^0.3.8",
"pkg-pr-new": "^0.0.24",
"nuxt-auth-utils": "^0.4.0",
"pkg-pr-new": "^0.0.28",
"typescript": "latest",
"vitest": "^2.1.1",
"vue-tsc": "^2.1.6"
Expand Down
2 changes: 1 addition & 1 deletion playground/server/routes/auth/github.get.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default oauthGitHubEventHandler({
export default defineOAuthGitHubEventHandler({
config: {
emailRequired: true,
},
Expand Down
129 changes: 119 additions & 10 deletions pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import { useSlipAuth } from "../utils/useSlipAuth";
import type { SlipAuthPublicSession } from "../../types";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore yolo the DX is not great
import { defineNitroPlugin, createError, sessionHooks } from "#imports";
import { defineNitroPlugin, createError, sessionHooks, hashPassword, verifyPassword } from "#imports";

export default defineNitroPlugin(() => {
const auth = useSlipAuth();

if (typeof hashPassword !== "undefined" && typeof verifyPassword !== "undefined") {
auth.setPasswordHashingMethods(() => {
return {
hash: hashPassword,
verify: verifyPassword,
};
});
}

if (typeof sessionHooks !== "undefined") {
sessionHooks.hook("fetch", async (session: SlipAuthPublicSession) => {
// invalid session if not in database
Expand Down

0 comments on commit f943075

Please sign in to comment.