mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-17 02:31:18 +01:00
✨ Add password strength indicator and use crypto safe random PWs
This commit is contained in:
17
src/server/api/routers/password.ts
Normal file
17
src/server/api/routers/password.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { generate } from 'generate-password';
|
||||
|
||||
import { createTRPCRouter, publicProcedure } from "../trpc";
|
||||
|
||||
export const passwordRouter = createTRPCRouter({
|
||||
generate: publicProcedure.mutation(() => {
|
||||
return generate({
|
||||
strict: true,
|
||||
numbers: true,
|
||||
lowercase: true,
|
||||
uppercase: true,
|
||||
symbols: true,
|
||||
excludeSimilarCharacters: true,
|
||||
length: 16
|
||||
})
|
||||
}),
|
||||
});
|
||||
Reference in New Issue
Block a user