Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Removed all references to commonPasswords & the data file. This api route can be deprecated in favor of the client-side secure call to the haveIBeenPwnd password API. Further the datafile contains no passwords that meet the minimum password criteria.

Joel Biddle3e36adcf5c47
diff --git a/backend/src/controllers/v1/authController.ts b/backend/src/controllers/v1/authController.ts
index 03a9a7717e..14c717e385 100644
--- a/backend/src/controllers/v1/authController.ts
+++ b/backend/src/controllers/v1/authController.ts
@@ -1,32 +1,20 @@
import { Request, Response } from "express";
-import fs from "fs";
-import path from "path";
import jwt from "jsonwebtoken";
import * as bigintConversion from "bigint-conversion";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const jsrp = require("jsrp");
-import {
- LoginSRPDetail,
- TokenVersion,
- User,
-} from "../../models";
+import { LoginSRPDetail, TokenVersion, User } from "../../models";
import { clearTokens, createToken, issueAuthTokens } from "../../helpers/auth";
import { checkUserDevice } from "../../helpers/user";
-import {
- ACTION_LOGIN,
- ACTION_LOGOUT,
-} from "../../variables";
-import {
- BadRequestError,
- UnauthorizedRequestError,
-} from "../../utils/errors";
+import { ACTION_LOGIN, ACTION_LOGOUT } from "../../variables";
+import { BadRequestError, UnauthorizedRequestError } from "../../utils/errors";
import { EELogService } from "../../ee/services";
import { getUserAgentType } from "../../utils/posthog";
import {
getHttpsEnabled,
getJwtAuthLifetime,
getJwtAuthSecret,
- getJwtRefreshSecret,
+ getJwtRefreshSecret
} from "../../config";
import { ActorType } from "../../ee/models";
@@ -44,13 +32,10 @@ declare module "jsonwebtoken" {
* @returns
*/
export const login1 = async (req: Request, res: Response) => {
- const {
- email,
- clientPublicKey,
- }: { email: string; clientPublicKey: string } = req.body;
+ const { email, clientPublicKey }: { email: string; clientPublicKey: string } = req.body;
const user = await User.findOne({
- email,
+ email
}).select("+salt +verifier");
if (!user) throw new Error("Failed to find user");
@@ -59,21 +44,25 @@ export const login1 = async (req: Request, res: Response) => {
server.init(
{
salt: user.salt,
- verifier: user.verifier,
+ verifier: user.verifier
},
async () => {
// generate server-side public key
const serverPublicKey = server.getPublicKey();
- await LoginSRPDetail.findOneAndReplace({ email: email }, {
- email: email,
- clientPublicKey: clientPublicKey,
- serverBInt: bigintConversion.bigintToBuf(server.bInt),
- }, { upsert: true, returnNewDocument: false })
+ await LoginSRPDetail.findOneAndReplace(
+ { email: email },
+ {
+ email: email,
+ clientPublicKey: clientPublicKey,
+ serverBInt: bigintConversion.bigintToBuf(server.bInt)
+ },
+ { upsert: true, returnNewDocument: false }
+ );
return res.status(200).send({
serverPublicKey,
- salt: user.salt,
+ salt: user.salt
});
}
);
@@ -89,15 +78,19 @@ export const login1 = async (req: Request, res: Response) => {
export const login2 = async (req: Request, res: Response) => {
const { email, clientProof } = req.body;
const user = await User.findOne({
- email,
+ email
}).select("+salt +verifier +publicKey +encryptedPrivateKey +iv +tag");
if (!user) throw new Error("Failed to find user");
- const loginSRPDetailFromDB = await LoginSRPDetail.findOneAndDelete({ email: email })
+ const loginSRPDetailFromDB = await LoginSRPDetail.findOneAndDelete({ email: email });
if (!loginSRPDetailFromDB) {
- return BadRequestError(Error("It looks like some details from the first login are not found. Please try login one again"))
+ return BadRequestError(
+ Error(
+ "It looks like some details from the first login are not found. Please try login one again"
+ )
+ );
}
const server = new jsrp.server();
@@ -105,7 +98,7 @@ export const login2 = async (req: Request, res: Response) => {
{
salt: user.salt,
verifier: user.verifier,
- b: loginSRPDetailFromDB.serverBInt,
+ b: loginSRPDetailFromDB.serverBInt
},
async () => {
server.setClientPublicKey(loginSRPDetailFromDB.clientPublicKey);
@@ -117,13 +110,13 @@ export const login2 = async (req: Request, res: Response) => {
await checkUserDevice({
user,
ip: req.realIP,
- userAgent: req.headers["user-agent"] ?? "",
+ userAgent: req.headers["user-agent"] ?? ""
});
- const tokens = await issueAuthTokens({
+ const tokens = await issueAuthTokens({
userId: user._id,
ip: req.realIP,
- userAgent: req.headers["user-agent"] ?? "",
+ userAgent: req.headers["user-agent"] ?? ""
});
// store (refresh) token in httpOnly cookie
@@ -131,20 +124,21 @@ export const login2 = async (req: Request, res: Response) => {
httpOnly: true,
path: "/",
sameSite: "strict",
- secure: await getHttpsEnabled(),
+ secure: await getHttpsEnabled()
});
const loginAction = await EELogService.createAction({
name: ACTION_LOGIN,
- userId: user._id,
+ userId: user._id
});
- loginAction && await EELogService.createLog({
- userId: user._id,
- actions: [loginAction],
- channel: getUserAgentType(req.headers["user-agent"]),
- ipAddress: req.realIP,
- });
+ loginAction &&
+ (await EELogService.createLog({
+ userId: user._id,
+ actions: [loginAction],
+ channel: getUserAgentType(req.headers["user-agent"]),
+ ipAddress: req.realIP
+ }));
// return (access) token in response
return res.status(200).send({
@@ -152,12 +146,12 @@ export const login2 = async (req: Request, res: Response) => {
publicKey: user.publicKey,
encryptedPrivateKey: user.encryptedPrivateKey,
iv: user.iv,
- tag: user.tag,
+ tag: user.tag
});
}
return res.status(400).send({
- message: "Failed to authenticate. Try again?",
+ message: "Failed to authenticate. Try again?"
});
}
);
@@ -171,7 +165,7 @@ export const login2 = async (req: Request, res: Response) => {
*/
export const logout = async (req: Request, res: Response) => {
if (req.authData.actor.type === ActorType.USER && req.authData.tokenVersionId) {
- await clearTokens(req.authData.tokenVersionId)
+ await clearTokens(req.authData.tokenVersionId);
}
// clear httpOnly cookie
@@ -179,49 +173,44 @@ export const logout = async (req: Request, res: Response) => {
httpOnly: true,
path: "/",
sameSite: "strict",
- secure: (await getHttpsEnabled()) as boolean,
+ secure: (await getHttpsEnabled()) as boolean
});
const logoutAction = await EELogService.createAction({
name: ACTION_LOGOUT,
- userId: req.user._id,
+ userId: req.user._id
});
- logoutAction && await EELogService.createLog({
- userId: req.user._id,
- actions: [logoutAction],
- channel: getUserAgentType(req.headers["user-agent"]),
- ipAddress: req.realIP,
- });
+ logoutAction &&
+ (await EELogService.createLog({
+ userId: req.user._id,
+ actions: [logoutAction],
+ channel: getUserAgentType(req.headers["user-agent"]),
+ ipAddress: req.realIP
+ }));
return res.status(200).send({
- message: "Successfully logged out.",
+ message: "Successfully logged out."
});
};
-export const getCommonPasswords = async (req: Request, res: Response) => {
- const commonPasswords = fs.readFileSync(
- path.resolve(__dirname, "../../data/" + "common_passwords.txt"),
- "utf8"
- ).split("\n");
-
- return res.status(200).send(commonPasswords);
-}
-
export const revokeAllSessions = async (req: Request, res: Response) => {
- await TokenVersion.updateMany({
- user: req.user._id,
- }, {
- $inc: {
- refreshVersion: 1,
- accessVersion: 1,
+ await TokenVersion.updateMany(
+ {
+ user: req.user._id
},
- });
+ {
+ $inc: {
+ refreshVersion: 1,
+ accessVersion: 1
+ }
+ }
+ );
return res.status(200).send({
- message: "Successfully revoked all sessions.",
- });
-}
+ message: "Successfully revoked all sessions."
+ });
+};
/**
* Return user is authenticated
@@ -231,9 +220,9 @@ export const revokeAllSessions = async (req: Request, res: Response) => {
*/
export const checkAuth = async (req: Request, res: Response) => {
return res.status(200).send({
- message: "Authenticated",
+ message: "Authenticated"
});
-}
+};
/**
* Return new JWT access token by first validating the refresh token
@@ -244,47 +233,47 @@ export const checkAuth = async (req: Request, res: Response) => {
export const getNewToken = async (req: Request, res: Response) => {
const refreshToken = req.cookies.jid;
- if (!refreshToken) throw BadRequestError({
- message: "Failed to find refresh token in request cookies"
- });
+ if (!refreshToken)
+ throw BadRequestError({
+ message: "Failed to find refresh token in request cookies"
+ });
- const decodedToken = <jwt.UserIDJwtPayload>(
- jwt.verify(refreshToken, await getJwtRefreshSecret())
- );
+ const decodedToken = <jwt.UserIDJwtPayload>jwt.verify(refreshToken, await getJwtRefreshSecret());
const user = await User.findOne({
- _id: decodedToken.userId,
+ _id: decodedToken.userId
}).select("+publicKey +refreshVersion +accessVersion");
if (!user) throw new Error("Failed to authenticate unfound user");
- if (!user?.publicKey)
- throw new Error("Failed to authenticate not fully set up account");
-
+ if (!user?.publicKey) throw new Error("Failed to authenticate not fully set up account");
+
const tokenVersion = await TokenVersion.findById(decodedToken.tokenVersionId);
- if (!tokenVersion) throw UnauthorizedRequestError({
- message: "Failed to validate refresh token",
- });
+ if (!tokenVersion)
+ throw UnauthorizedRequestError({
+ message: "Failed to validate refresh token"
+ });
- if (decodedToken.refreshVersion !== tokenVersion.refreshVersion) throw BadRequestError({
- message: "Failed to validate refresh token",
- });
+ if (decodedToken.refreshVersion !== tokenVersion.refreshVersion)
+ throw BadRequestError({
+ message: "Failed to validate refresh token"
+ });
const token = createToken({
payload: {
userId: decodedToken.userId,
tokenVersionId: tokenVersion._id.toString(),
- accessVersion: tokenVersion.refreshVersion,
+ accessVersion: tokenVersion.refreshVersion
},
expiresIn: await getJwtAuthLifetime(),
- secret: await getJwtAuthSecret(),
+ secret: await getJwtAuthSecret()
});
return res.status(200).send({
- token,
+ token
});
};
export const handleAuthProviderCallback = (req: Request, res: Response) => {
res.redirect(`/login/provider/success?token=${encodeURIComponent(req.providerAuthToken)}`);
-}
+};
diff --git a/backend/src/data/common_passwords.txt b/backend/src/data/common_passwords.txt
deleted file mode 100644
index 01a442b17f..0000000000
--- a/backend/src/data/common_passwords.txt
+++ /dev/null
@@ -1,1497 +0,0 @@
-123456
-123456789
-111111
-password
-qwerty
-abc123
-12345678
-password1
-1234567
-123123
-1234567890
-000000
-12345
-iloveyou
-1q2w3e4r5t
-1234
-123456a
-qwertyuiop
-monkey
-123321
-dragon
-654321
-666666
-123
-myspace1
-a123456
-121212
-1qaz2wsx
-123qwe
-123abc
-tinkle
-target123
-gwerty
-1g2w3e4r
-gwerty123
-zag12wsx
-7777777
-qwerty1
-1q2w3e4r
-987654321
-222222
-qwe123
-qwerty123
-zxcvbnm
-555555
-112233
-fuckyou
-asdfghjkl
-12345a
-123123123
-1q2w3e
-qazwsx
-computer
-aaaaaa
-159753
-iloveyou1
-fuckyou1
-princess
-789456123
-11111111
-123654
-princess1
-888888
-linkedin
-michael
-sunshine
-football
-11111
-777777
-1234qwer
-999999
-j38ifUbn
-monkey1
-football1
-daniel
-azerty
-a12345
-123456789a
-789456
-asdfgh
-love123
-abcd1234
-jordan23
-88888888
-5201314
-12qwaszx
-FQRG7CS493
-ashley
-asdf
-asd123
-superman
-jessica
-love
-samsung
-shadow
-blink182
-333333
-michael1
-babygirl1
-jesus1
-qwert
-k.:
-baseball
-charlie
-0
-hello1
-soccer
-killer
-131313
-master
-1111111
-gfhjkm
-0123456789
-987654
-iloveyou2
-angel1
-jordan
-147258369
-bitch1
-michelle
-q1w2e3r4
-jessica1
-qwer1234
-159357
-soccer1
-liverpool
-101010
-zxcvbn
-thomas
-asdasd
-fuckyou2
-justin
-nicole
-1111111111
-1
-1111
-qazwsxedc
-baseball1
-andrew
-hello
-apple
-0987654321
-anthony1
-102030
-money1
-parola
-abc
-147258
-anthony
-111222
-jennifer
-number1
-naruto
-123456q
-696969
-00000000
-joshua
-golfer
-29rsavoy
-myspace
-andrea
-basketball
-qwerty12
-charlie1
-passw0rd
-asshole1
-hunter
-marina
-welcome
-010203
-superman1
-password12
-xbox360
-sunshine1
-ashley1
-lovely
-babygirl
-!
-trustno1
-666
-asdf1234
-chocolate
-buster
-summer
-tigger
-purple
-freedom
-loveme
-matthew
-50cent
-password2
-maggie
-george
-chelsea
-12341234
-amanda
-hannah
-q1w2e3
-friends
-shadow1
-william
-abcdefg
-samantha
-12344321
-nicole1
-q1w2e3r4t5y6
-robert
-mother
-jordan1
-secret
-letmein
-qweasdzxc
-212121
-pokemon
-$HEX
-internet
-batman
-love12
-a123456789
-VQsaBLPzLa
-qweqwe
-hello123
-232323
-butterfly
-martin
-flower
-forever
-mustang
-1qazxsw2
-iloveu
-cjmasterinf
-orange
-harley
-user
-brandon1
-london
-1234567891
-pepper
-chris1
-lol123
-abcdef
-whatever
-1342
-alexander
-loveyou
-290966
-wall.e
-junior
-12413
-qweasd
-PE#5GZ29PTZMSE
-tudelft
-dpbk1234
-DIOSESFIEL
-U38fa39
-147852
-cookie
-family
-jasmine
-dragon1
-12345q
-nikita
-pakistan
-123654789
-123789
-amanda1
-joseph
-happy1
-ginger
-:
-matthew1
-snoopy
-justin1
-lastfm
-3rJs1la7qE
-пїЅпїЅпїЅпїЅпїЅпїЅ
-antonio
-barcelona
-matrix
-computer1
-hottie1
-sophie
-sandra
-michelle1
-12345678910
-qqqqqq
-arsenal
-444444
-brandon
-daniel1
-jonathan
-killer1
-liverpool1
-mickey
-ghbdtn
-purple1
-mercedes
-patrick
-11223344
-diamond
-456789
-victoria
-asshole
-taylor
-qwertyu
-andrew1
-red123
-lucky1
-eminem
-12345qwert
-111222tianya
-yellow
-william1
-bailey
-angel
-chicken1
-richard
-0000
-banana
-0000000000
-jasmine1
-benjamin
-welcome1
-starwars
-hunter1
-cheese
-melissa
-angela
-christian
-1234554321
-oliver
-chocolate1
-butterfly1
-peanut
-55555
-hockey
-mylove
-natasha
-NULL
-mommy1
-1234561
-q1w2e3r4t5
-america
-252525
-monster
-school
-456123
-james1
-slipknot
-hannah1
-zaq12wsx
-chicken
-147852369
-gabriel
-elizabeth
-cookie1
-Status
-87654321
-robert1
-ferrari
-nathan
-1password
-buddy1
-1314520
-america1
-metallica
-chelsea1
-zzzzzz
-prince
-adidas
-jackson
-morgan
-rainbow
-silver
-1234567a
-angels
-iw14Fi9j
-loveme1
-juventus
-jennifer1
-!~!1
-bubbles
-samuel
-fuckoff
-lovers
-cheese1
-0123456
-123asd
-999999999
-madison
-elizabeth1
-music
-buster1
-lauren
-david1
-tigger1
-123qweasd
-taylor1
-carlos
-tinkerbell
-samantha1
-Sojdlg123aljg
-joshua1
-poop
-stella
-myspace123
-asdasd5
-freedom1
-whatever1
-xxxxxx
-00000
-valentina
-a1b2c3
-741852963
-austin
-monica
-qaz123
-lovely1
-music1
-harley1
-family1
-spongebob1
-steven
-nirvana
-1234abcd
-hellokitty
-thomas1
-7654321
-madison1
-daddy1
-summer1
-cocacola
-nicholas
-zxc123
-123456m
-qwertyui
-spiderman
-vanessa
-diamond1
-142536
-danielle
-badoo
-7758521
-bandit
-pokemon1
-mustang1
-1qaz2wsx3edc
-alexis
-loulou
-justinbieb
-yamaha
-qwert1
-scooter
-rachel
-tennis
-ronaldo
-i
-mexico1
-friends1
-victor
-maggie1
-asdfasdf
-qwerty12345
-lover1
-jesus
-123hfjdk147
-nicolas
-batman1
-weed420
-password123
-loser1
-123456j
-iloveyou!
-pepper1
-fuckoff1
-555666
-iloveu2
-sabrina
-pussy1
-bubbles1
-098765
-master1
-smokey
-a1b2c3d4
-123456789q
-qwaszx
-heather
-jasper
-booboo
-heather1
-4815162342
-peanut1
-chester
-123456s
-123456b
-google
-edward
-yankees1
-canada
-Exigent
-destiny
-success
-nigger1
-135790
-asdfghjkl1
-124578
-casper
-lalala
-mother1
-sexy123
-qazxsw
-naruto1
-1q2w3e4r5t6y
-david
-money
-yellow1
-patrick1
-flower1
-12121212
-alexander1
-raiders1
-Password1
-sebastian
-134679
-zxcvbnm1
-dennis
-852456
-hahaha
-daniela
-ginger1
-olivia
-melissa1
-010101
-slipknot1
-spiderman1
-cowboys1
-0000000
-rebecca
-741852
-jeremy
-a1234567
-dakota
-123456d
-1a2b3c
-apple1
-november
-alexandra
-159951
-iloveu1
-veronica
-fuckme1
-baby123
-yankees
-stupid1
-cristina
-newyork1
-jackson1
-playboy
-friend
-iloveyou12
-sammy1
-pimpin1
-phoenix
-PolniyPizdec0211
-rocky1
-password!
-joseph1
-753951
-p
-a838hfiD
-richard1
-beautiful1
-mickey1
-carolina
-j123456
-202020
-newyork
-patricia
-charles
-stephanie
-orange1
-m123456
-421uiopy258
-myspace2
-cameron
-spider
-barbie
-woaini
-vincent
-mexico
-scorpion
-monster1
-aaaaa
-elephant
-asdf123
-963852741
-zk.:
-guitar
-fucker1
-destiny1
-hotmail
-johnny
-doudou
-q123456
-bailey1
-asdfgh1
-fucker
-louise
-sparky
-sweety
-123456abc
-shorty1
-booboo1
-december
-9876543210
-manchester
-midnight
-246810
-jessie
-dallas
-austin1
-s123456
-pass
-12345678a
-claudia
-пїЅпїЅпїЅпїЅпїЅпїЅпїЅ
-kristina
-lakers
-lovelove
-crazy1
-tiger1
-thunder
-dolphin
-a
-gangsta1
-jackie
-151515
-charlotte
-scooter1
-caroline
-fuck
-merlin
-junior1
-super123
-scooby
-marseille
-aaaa
-metallica1
-kitty1
-chris
-beautiful
-black1
-danielle1
-blessed1
-skater1
-1029384756
-qazwsx123
-456456
-b123456
-genius
-guitar1
-tyler1
-peaches
-california
-sakura
-tigers
-soleil
-lauren1
-green1
-smokey1
-cooper
-520520
-muffin
-christian1
-love13
-fucku2
-arsenal1
-lucky7
-diablo
-apples
-george1
-babyboy1
-crystal
-1122334455
-player1
-aa123456
-vfhbyf
-forever1
-Password
-winston
-chivas1
-sexy
-hockey1
-1a2b3c4d
-pussy
-playboy1
-stalker
-cherry
-tweety
-toyota
-creative
-gemini
-pretty1
-пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ
-maverick
-brittany1
-nathan1
-letmein1
-cameron1
-secret1
-google1
-heaven
-martina
-murphy
-spongebob
-uQA9Ebw445
-fernando
-pretty
-startfinding
-softball
-dolphin1
-fuckme
-test123
-qwerty1234
-kobe24
-alejandro
-adrian
-september
-aaaaaa1
-bubba1
-isabella
-abc123456
-password3
-jason1
-abcdefg123
-loveyou1
-shannon
-100200
-manuel
-leonardo
-molly1
-flowers
-123456z
-007007
-password.
-321321
-miguel
-samsung1
-sergey
-sweet1
-abc1234
-windows
-qwert123
-vfrcbv
-poohbear
-d123456
-school1
-badboy
-951753
-123456c
-111
-steven1
-snoopy1
-garfield
-YAgjecc826
-compaq
-candy1
-sarah1
-qwerty123456
-123456l
-eminem1
-141414
-789789
-maria
-steelers
-iloveme1
-morgan1
-winner
-boomer
-lolita
-nastya
-alexis1
-carmen
-angelo
-nicholas1
-portugal
-precious
-jackass1
-jonathan1
-yfnfif
-bitch
-tiffany
-rabbit
-rainbow1
-angel123
-popcorn
-barbara
-brandy
-fuckyou!
-starwars1
-barney
-natalia
-hiphop
-tiffany1
-shorty
-poohbear1
-simone
-albert
-marlboro
-hardcore
-cowboys
-sydney
-alex
-scorpio
-1234512345
-q12345
-qq123456
-onelove
-bond007
-abcdefg1
-eagles
-crystal1
-azertyuiop
-winter
-sexy12
-angelina
-james
-svetlana
-fatima
-123456k
-icecream
-popcorn1
-121314
-john316
-qazwsx1
-victoria1
-twilight
-iloveme
-9379992
-pass123
-dancer
-brittany
-beauty
-bonjour
-maxwell
-coffee
-dexter
-454545
-qazqaz
-snickers
-love11
-samson
-aaaaaaaa
-swordfish
-fyfcnfcbz
-abcd123
-aaa111
-natalie
-hottie
-passion
-alyssa
-rockstar1
-lovers1
-florida
-alicia
-happy
-blue123
-123456t
-ranger
-yourmom1
-pumpkin
-denise
-edward1
-tweety1
-christine
-august
-54321
-bella1
-marie1
-seven7
-steelers1
-aaaaa1
-shannon1
-amber1
-cutie1
-peaches1
-florida1
-bonnie
-stephanie1
-lollipop
-cassie
-k.
-rachel1
-greenday1
-krishna
-teresa
-october
-iverson3
-motorola
-rockstar
-hahaha1
-police
-lakers24
-fylhtq
-andrey
-loveme2
-turtle
-southside1
-baby
-bismillah
-pa55word
-blessed
-emmanuel
-666999
-012345
-fluffy
-5555555555
-stupid
-karina
-fishing
-musica
-password11
-love4ever
-melanie
-greenday
-isabelle
-nothing
-abcd
-chicago
-cowboy
-mnbvcxz
-andrea1
-242424
-babygurl1
-santiago
-ssssss
-kevin1
-lakers1
-chester1
-321654
-kimberly
-carlos1
-z123456
-daisy1
-jackass
-m
-5555555
-zoosk
-boston
-happy123
-55555555
-satan666
-111111a
-pamela
-090909
-francesco
-horses
-456852
-qwer
-vanessa1
-redsox
-pookie
-a12345678
-110110
-tucker
-marley
-corvette
-778899
-realmadrid
-raiders
-rangers
-people
-1123581321
-soccer12
-sayang
-shelby
-christ
-12345t
-fktrcfylh
-kitten
-player
-c123456
-qwert12345
-baby12
-trinity
-1v7Upjw3nT
-p@ssw0rd
-thunder1
-zxcvbnm123
-midnight1
-lebron23
-golden
-strawberry
-orlando
-love1234
-lucky13
-asdfg1
-marine
-soccer10123456
-password
-12345678
-1234
-pussy
-12345
-dragon
-qwerty
-696969
-mustang
-letmein
-baseball
-master
-michael
-football
-shadow
-monkey
-abc123
-pass
-fuckme
-6969
-jordan
-harley
-ranger
-iwantu
-jennifer
-hunter
-fuck
-2000
-test
-batman
-trustno1
-thomas
-tigger
-robert
-access
-love
-buster
-1234567
-soccer
-hockey
-killer
-george
-sexy
-andrew
-charlie
-superman
-asshole
-fuckyou
-dallas
-jessica
-panties
-pepper
-1111
-austin
-william
-daniel
-golfer
-summer
-heather
-hammer
-yankees
-joshua
-maggie
-biteme
-enter
-ashley
-thunder
-cowboy
-silver
-richard
-fucker
-orange
-merlin
-michelle
-corvette
-bigdog
-cheese
-matthew
-121212
-patrick
-martin
-freedom
-ginger
-blowjob
-nicole
-sparky
-yellow
-camaro
-secret
-dick
-falcon
-taylor
-111111
-131313
-123123
-bitch
-hello
-scooter
-please
-porsche
-guitar
-chelsea
-black
-diamond
-nascar
-jackson
-cameron
-654321
-computer
-amanda
-wizard
-xxxxxxxx
-money
-phoenix
-mickey
-bailey
-knight
-iceman
-tigers
-purple
-andrea
-horny
-dakota
-aaaaaa
-player
-sunshine
-morgan
-starwars
-boomer
-cowboys
-edward
-charles
-girls
-booboo
-coffee
-xxxxxx
-bulldog
-ncc1701
-rabbit
-peanut
-john
-johnny
-gandalf
-spanky
-winter
-brandy
-compaq
-carlos
-tennis
-james
-mike
-brandon
-fender
-anthony
-blowme
-ferrari
-cookie
-chicken
-maverick
-chicago
-joseph
-diablo
-sexsex
-hardcore
-666666
-willie
-welcome
-chris
-panther
-yamaha
-justin
-banana
-driver
-marine
-angels
-fishing
-david
-maddog
-hooters
-wilson
-butthead
-dennis
-fucking
-captain
-bigdick
-chester
-smokey
-xavier
-steven
-viking
-snoopy
-blue
-eagles
-winner
-samantha
-house
-miller
-flower
-jack
-firebird
-butter
-united
-turtle
-steelers
-tiffany
-zxcvbn
-tomcat
-golf
-bond007
-bear
-tiger
-doctor
-gateway
-gators
-angel
-junior
-thx1138
-porno
-badboy
-debbie
-spider
-melissa
-booger
-1212
-flyers
-fish
-porn
-matrix
-teens
-scooby
-jason
-walter
-cumshot
-boston
-braves
-yankee
-lover
-barney
-victor
-tucker
-princess
-mercedes
-5150
-doggie
-zzzzzz
-gunner
-horney
-bubba
-2112
-fred
-johnson
-xxxxx
-tits
-member
-boobs
-donald
-bigdaddy
-bronco
-penis
-voyager
-rangers
-birdie
-trouble
-white
-topgun
-bigtits
-bitches
-green
-super
-qazwsx
-magic
-lakers
-rachel
-slayer
-scott
-2222
-asdf
-video
-london
-7777
-marlboro
-srinivas
-internet
-action
-carter
-jasper
-monster
-teresa
-jeremy
-11111111
-bill
-crystal
-peter
-pussies
-cock
-beer
-rocket
-theman
-oliver
-prince
-beach
-amateur
-7777777
-muffin
-redsox
-star
-testing
-shannon
-murphy
-frank
-hannah
-dave
-eagle1
-11111
-mother
-nathan
-raiders
-steve
-forever
-angela
-viper
-ou812
-jake
-lovers
-suckit
-gregory
-buddy
-whatever
-young
-nicholas
-lucky
-helpme
-jackie
-monica
-midnight
-college
-baby
-cunt
-brian
-mark
-startrek
-sierra
-leather
-232323
-4444
-beavis
-bigcock
-happy
-sophie
-ladies
-naughty
-giants
-booty
-blonde
-fucked
-golden
-0
-fire
-sandra
-pookie
-packers
-einstein
-dolphins
-chevy
-winston
-warrior
-sammy
-slut
-8675309
-zxcvbnm
-nipples
-power
-victoria
-asdfgh
-vagina
-toyota
-travis
-hotdog
-paris
-rock
-xxxx
-extreme
-redskins
-erotic
-dirty
-ford
-freddy
-arsenal
-access14
-wolf
-nipple
-iloveyou
-alex
-florida
-eric
-legend
-movie
-success
-rosebud
-jaguar
-great
-cool
-cooper
-1313
-scorpio
-mountain
-madison
-987654
-brazil
-lauren
-japan
-naked
-squirt
-stars
-apple
-alexis
-aaaa
-bonnie
-peaches
-jasmine
-kevin
-matt
-qwertyui
-danielle
-beaver
-4321
-4128
-runner
-swimming
-dolphin
-gordon
-casper
-stupid
-shit
-saturn
-gemini
-apples
-august
-3333
-canada
-blazer
-cumming
-hunting
-kitty
-rainbow
-112233
-arthur
-cream
-calvin
-shaved
-surfer
-samson
-kelly
-paul
-mine
-king
-racing
-5555
-eagle
-hentai
-newyork
-little
-redwings
-smith
-sticky
-cocacola
-animal
-broncos
-private
-skippy
-marvin
-blondes
-enjoy
-girl
-apollo
-parker
-qwert
-time
-sydney
-women
-voodoo
-magnum
-juice
-abgrtyu
-777777
-dreams
-maxwell
-music
-rush2112
-russia
-scorpion
-rebecca
-tester
-mistress
-phantom
-billy
-6666
-albert
\ No newline at end of file
diff --git a/backend/src/routes/v1/auth.ts b/backend/src/routes/v1/auth.ts
index b633f82ea6..ab141ac05e 100644
--- a/backend/src/routes/v1/auth.ts
+++ b/backend/src/routes/v1/auth.ts
@@ -8,7 +8,8 @@ import { AuthMode } from "../../variables";
router.post("/token", validateRequest, authController.getNewToken);
-router.post( // TODO endpoint: deprecate (moved to api/v3/auth/login1)
+router.post(
+ // TODO endpoint: deprecate (moved to api/v3/auth/login1)
"/login1",
authLimiter,
body("email").exists().trim().notEmpty(),
@@ -17,7 +18,8 @@ router.post( // TODO endpoint: deprecate (moved to api/v3/auth/login1)
authController.login1
);
-router.post( // TODO endpoint: deprecate (moved to api/v3/auth/login2)
+router.post(
+ // TODO endpoint: deprecate (moved to api/v3/auth/login2)
"/login2",
authLimiter,
body("email").exists().trim().notEmpty(),
@@ -30,7 +32,7 @@ router.post(
"/logout",
authLimiter,
requireAuth({
- acceptedAuthModes: [AuthMode.JWT],
+ acceptedAuthModes: [AuthMode.JWT]
}),
authController.logout
);
@@ -38,24 +40,19 @@ router.post(
router.post(
"/checkAuth",
requireAuth({
- acceptedAuthModes: [AuthMode.JWT],
+ acceptedAuthModes: [AuthMode.JWT]
}),
authController.checkAuth
);
-router.get(
- "/common-passwords",
- authLimiter,
- authController.getCommonPasswords
-);
-
-router.delete( // TODO endpoint: deprecate (moved to DELETE v2/users/me/sessions)
+router.delete(
+ // TODO endpoint: deprecate (moved to DELETE v2/users/me/sessions)
"/sessions",
authLimiter,
requireAuth({
- acceptedAuthModes: [AuthMode.JWT],
- }),
+ acceptedAuthModes: [AuthMode.JWT]
+ }),
authController.revokeAllSessions
);
-export default router;
\ No newline at end of file
+export default router;
diff --git a/frontend/src/components/signup/UserInfoStep.tsx b/frontend/src/components/signup/UserInfoStep.tsx
index 45ae09d0dd..0cce660e00 100644
--- a/frontend/src/components/signup/UserInfoStep.tsx
+++ b/frontend/src/components/signup/UserInfoStep.tsx
@@ -8,7 +8,6 @@ import jsrp from "jsrp";
import nacl from "tweetnacl";
import { encodeBase64 } from "tweetnacl-util";
-import { useGetCommonPasswords } from "@app/hooks/api";
import { completeAccountSignup } from "@app/hooks/api/auth/queries";
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
import ProjectService from "@app/services/ProjectService";
@@ -47,7 +46,6 @@ type Errors = {
specialChar?: string;
repeatedChar?: string;
isBeachedPassword?: string;
- isCommonPassword?: string;
};
/**
@@ -76,7 +74,6 @@ export default function UserInfoStep({
setAttributionSource,
providerAuthToken
}: UserInfoStepProps): JSX.Element {
- const { data: commonPasswords } = useGetCommonPasswords();
const [nameError, setNameError] = useState(false);
const [organizationNameError, setOrganizationNameError] = useState(false);
@@ -105,7 +102,6 @@ export default function UserInfoStep({
errorCheck = await checkPassword({
password,
- commonPasswords,
setErrors
});
@@ -272,11 +268,10 @@ export default function UserInfoStep({
<div className="mt-2 flex max-h-60 w-1/4 w-full min-w-[20rem] flex-col items-center justify-center rounded-lg py-2 lg:w-1/6">
<InputField
label={t("section.password.password")}
- onChangeHandler={(pass: string) => {
+ onChangeHandler={async (pass: string) => {
setPassword(pass);
- checkPassword({
+ await checkPassword({
password: pass,
- commonPasswords,
setErrors
});
}}
diff --git a/frontend/src/components/utilities/checks/checkPassword.ts b/frontend/src/components/utilities/checks/checkPassword.ts
index 8ad4c6032b..aaa8bac7fb 100644
--- a/frontend/src/components/utilities/checks/checkPassword.ts
+++ b/frontend/src/components/utilities/checks/checkPassword.ts
@@ -9,12 +9,10 @@ type Errors = {
specialChar?: string;
repeatedChar?: string;
isBreachedPassword?: string;
- isCommonPassword?: string;
};
interface CheckPasswordParams {
password: string;
- commonPasswords: string[];
setErrors: (value: Errors) => void;
}
@@ -28,7 +26,6 @@ interface CheckPasswordParams {
* - Contains at least 1 special character
* - Does not contain 3 repeat, consecutive characters
* - Is not in a database of breached passwords
- * - Is not in a list of common passwords
*
* The function returns whether or not the password [password]
* passes the minimum requirements above. It sets errors on
@@ -38,11 +35,7 @@ interface CheckPasswordParams {
* @param {String} obj.password - the password to check
* @param {Function} obj.setErrors - set state function to set error object
*/
-const checkPassword = async ({
- password,
- commonPasswords,
- setErrors
-}: CheckPasswordParams): Promise<boolean> => {
+const checkPassword = async ({ password, setErrors }: CheckPasswordParams): Promise<boolean> => {
const errors: Errors = {};
// tooShort
@@ -86,11 +79,6 @@ const checkPassword = async ({
"The password you provided is in a list of passwords commonly used on other websites. Please try again with a stronger password.";
}
- // commonPassword
- if (commonPasswords.includes(password)) {
- errors.isCommonPassword = "No common passwords";
- }
-
setErrors(errors);
return Object.keys(errors).length > 0;
};
diff --git a/frontend/src/hooks/api/auth/index.tsx b/frontend/src/hooks/api/auth/index.tsx
index dbcc77a5a2..66208a4871 100644
--- a/frontend/src/hooks/api/auth/index.tsx
+++ b/frontend/src/hooks/api/auth/index.tsx
@@ -1,10 +1,10 @@
export {
useGetAuthToken,
- useGetCommonPasswords,
useResetPassword,
- useSendMfaToken,
+ useSendMfaToken,
useSendPasswordResetEmail,
useSendVerificationEmail,
useVerifyEmailVerificationCode,
useVerifyMfaToken,
- useVerifyPasswordResetCode} from "./queries"
+ useVerifyPasswordResetCode
+} from "./queries";
diff --git a/frontend/src/hooks/api/auth/queries.tsx b/frontend/src/hooks/api/auth/queries.tsx
index 094fd4b611..a262977301 100644
--- a/frontend/src/hooks/api/auth/queries.tsx
+++ b/frontend/src/hooks/api/auth/queries.tsx
@@ -20,22 +20,22 @@ import {
SRPR1Res,
VerifyMfaTokenDTO,
VerifyMfaTokenRes,
- VerifySignupInviteDTO} from "./types";
+ VerifySignupInviteDTO
+} from "./types";
const authKeys = {
- getAuthToken: ["token"] as const,
- commonPasswords: ["common-passwords"] as const
+ getAuthToken: ["token"] as const
};
export const login1 = async (loginDetails: Login1DTO) => {
const { data } = await apiRequest.post<Login1Res>("/api/v3/auth/login1", loginDetails);
return data;
-}
+};
export const login2 = async (loginDetails: Login2DTO) => {
const { data } = await apiRequest.post<Login2Res>("/api/v3/auth/login2", loginDetails);
return data;
-}
+};
export const useLogin1 = () => {
return useMutation({
@@ -47,7 +47,7 @@ export const useLogin1 = () => {
return login1(details);
}
});
-}
+};
export const useLogin2 = () => {
return useMutation({
@@ -59,22 +59,22 @@ export const useLogin2 = () => {
return login2(details);
}
});
-}
+};
export const srp1 = async (details: SRP1DTO) => {
const { data } = await apiRequest.post<SRPR1Res>("/api/v1/password/srp1", details);
- return data;
-}
+ return data;
+};
export const completeAccountSignup = async (details: CompleteAccountSignupDTO) => {
const { data } = await apiRequest.post("/api/v3/signup/complete-account/signup", details);
- return data;
-}
+ return data;
+};
export const completeAccountSignupInvite = async (details: CompleteAccountDTO) => {
const { data } = await apiRequest.post("/api/v2/signup/complete-account/invite", details);
- return data;
-}
+ return data;
+};
export const useCompleteAccountSignup = () => {
return useMutation({
@@ -82,7 +82,7 @@ export const useCompleteAccountSignup = () => {
return completeAccountSignup(details);
}
});
-}
+};
export const useSendMfaToken = () => {
return useMutation<{}, {}, SendMfaTokenDTO>({
@@ -91,22 +91,16 @@ export const useSendMfaToken = () => {
return data;
}
});
-}
-
-export const verifyMfaToken = async ({
- email,
- mfaCode
-}: {
- email: string;
- mfaCode: string;
-}) => {
+};
+
+export const verifyMfaToken = async ({ email, mfaCode }: { email: string; mfaCode: string }) => {
const { data } = await apiRequest.post("/api/v2/auth/mfa/verify", {
email,
mfaToken: mfaCode
});
return data;
-}
+};
export const useVerifyMfaToken = () => {
return useMutation<VerifyMfaTokenRes, {}, VerifyMfaTokenDTO>({
@@ -117,87 +111,67 @@ export const useVerifyMfaToken = () => {
});
}
});
-}
+};
export const verifySignupInvite = async (details: VerifySignupInviteDTO) => {
const { data } = await apiRequest.post("/api/v1/invite-org/verify", details);
return data;
-}
+};
export const useSendVerificationEmail = () => {
return useMutation({
- mutationFn: async ({
- email
- }: {
- email: string;
- }) => {
+ mutationFn: async ({ email }: { email: string }) => {
const { data } = await apiRequest.post("/api/v1/signup/email/signup", {
email
});
-
+
return data;
}
});
-}
+};
export const useVerifyEmailVerificationCode = () => {
return useMutation({
- mutationFn: async ({
- email,
- code
- }: {
- email: string;
- code: string;
- }) => {
+ mutationFn: async ({ email, code }: { email: string; code: string }) => {
const { data } = await apiRequest.post("/api/v1/signup/email/verify", {
email,
code
});
-
+
return data;
}
});
-}
+};
export const useSendPasswordResetEmail = () => {
return useMutation({
- mutationFn: async ({
- email
- }: {
- email: string;
- }) => {
+ mutationFn: async ({ email }: { email: string }) => {
const { data } = await apiRequest.post("/api/v1/password/email/password-reset", {
email
});
-
+
return data;
}
});
-}
+};
export const useVerifyPasswordResetCode = () => {
return useMutation({
- mutationFn: async ({
- email,
- code
- }: {
- email: string;
- code: string;
- }) => {
+ mutationFn: async ({ email, code }: { email: string; code: string }) => {
const { data } = await apiRequest.post("/api/v1/password/email/password-reset-verify", {
email,
code
});
-
+
return data;
}
});
-}
+};
export const issueBackupPrivateKey = async (details: IssueBackupPrivateKeyDTO) => {
const { data } = await apiRequest.post("/api/v1/password/backup-private-key", details);
return data;
-}
+};
export const getBackupEncryptedPrivateKey = async ({
verificationToken
@@ -207,37 +181,41 @@ export const getBackupEncryptedPrivateKey = async ({
Authorization: `Bearer ${verificationToken}`
}
});
-
+
return data.backupPrivateKey;
-}
+};
export const useResetPassword = () => {
return useMutation({
mutationFn: async (details: ResetPasswordDTO) => {
- const { data } = await apiRequest.post("/api/v1/password/password-reset", {
- protectedKey: details.protectedKey,
- protectedKeyIV: details.protectedKeyIV,
- protectedKeyTag: details.protectedKeyTag,
- encryptedPrivateKey: details.encryptedPrivateKey,
- encryptedPrivateKeyIV: details.encryptedPrivateKeyIV,
- encryptedPrivateKeyTag: details.encryptedPrivateKeyTag,
- salt: details.salt,
- verifier: details.verifier
- }, {
- headers: {
- Authorization: `Bearer ${details.verificationToken}`
+ const { data } = await apiRequest.post(
+ "/api/v1/password/password-reset",
+ {
+ protectedKey: details.protectedKey,
+ protectedKeyIV: details.protectedKeyIV,
+ protectedKeyTag: details.protectedKeyTag,
+ encryptedPrivateKey: details.encryptedPrivateKey,
+ encryptedPrivateKeyIV: details.encryptedPrivateKeyIV,
+ encryptedPrivateKeyTag: details.encryptedPrivateKeyTag,
+ salt: details.salt,
+ verifier: details.verifier
+ },
+ {
+ headers: {
+ Authorization: `Bearer ${details.verificationToken}`
+ }
}
- });
-
+ );
+
return data;
}
});
-}
+};
export const changePassword = async (details: ChangePasswordDTO) => {
const { data } = await apiRequest.post("/api/v1/password/change-password", details);
return data;
-}
+};
export const useChangePassword = () => {
// note: use after srp1
@@ -246,7 +224,7 @@ export const useChangePassword = () => {
return changePassword(details);
}
});
-}
+};
// Refresh token is set as cookie when logged in
// Using that we fetch the auth bearer token needed for auth calls
@@ -263,11 +241,3 @@ export const useGetAuthToken = () =>
onSuccess: (data) => setAuthToken(data.token),
retry: 0
});
-
-const fetchCommonPasswords = async () => {
- const { data } = await apiRequest.get("/api/v1/auth/common-passwords");
- return data || [];
-};
-
-export const useGetCommonPasswords = () =>
- useQuery({ queryKey: authKeys.commonPasswords, queryFn: fetchCommonPasswords });
\ No newline at end of file
diff --git a/frontend/src/pages/signupinvite.tsx b/frontend/src/pages/signupinvite.tsx
index 894c36ea6e..7eb478352a 100644
--- a/frontend/src/pages/signupinvite.tsx
+++ b/frontend/src/pages/signupinvite.tsx
@@ -22,31 +22,23 @@ import { deriveArgonKey } from "@app/components/utilities/cryptography/crypto";
import issueBackupKey from "@app/components/utilities/cryptography/issueBackupKey";
import { saveTokenToLocalStorage } from "@app/components/utilities/saveTokenToLocalStorage";
import SecurityClient from "@app/components/utilities/SecurityClient";
-import {
- useGetCommonPasswords
-} from "@app/hooks/api";
-import {
- completeAccountSignupInvite,
- verifySignupInvite
-} from "@app/hooks/api/auth/queries";
+import { completeAccountSignupInvite, verifySignupInvite } from "@app/hooks/api/auth/queries";
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
// eslint-disable-next-line new-cap
const client = new jsrp.client();
type Errors = {
- length?: string,
- upperCase?: string,
- lowerCase?: string,
- number?: string,
- specialChar?: string,
- repeatedChar?: string,
- breachedPassword?: string
+ length?: string;
+ upperCase?: string;
+ lowerCase?: string;
+ number?: string;
+ specialChar?: string;
+ repeatedChar?: string;
+ breachedPassword?: string;
};
export default function SignupInvite() {
- const { data: commonPasswords } = useGetCommonPasswords();
-
const [password, setPassword] = useState("");
const [firstName, setFirstName] = useState("");
const [lastName, setLastName] = useState("");
@@ -80,10 +72,9 @@ export default function SignupInvite() {
} else {
setLastNameError(false);
}
-
+
errorCheck = await checkPassword({
password,
- commonPasswords,
setErrors
});
@@ -117,7 +108,7 @@ export default function SignupInvite() {
if (!derivedKey) throw new Error("Failed to derive key from password");
const key = crypto.randomBytes(32);
-
+
// create encrypted private key by encrypting the private
// key with the symmetric key [key]
const {
@@ -128,7 +119,7 @@ export default function SignupInvite() {
text: privateKey,
secret: key
});
-
+
// create the protected key by encrypting the symmetric key
// [key] with the derived key
const {
@@ -139,10 +130,8 @@ export default function SignupInvite() {
text: key.toString("hex"),
secret: Buffer.from(derivedKey.hash)
});
-
- const {
- token: jwtToken
- } = await completeAccountSignupInvite({
+
+ const { token: jwtToken } = await completeAccountSignupInvite({
email,
firstName,
lastName,
@@ -156,20 +145,20 @@ export default function SignupInvite() {
salt: result.salt,
verifier: result.verifier
});
-
+
// unset temporary signup JWT token and set JWT token
SecurityClient.setSignupToken("");
SecurityClient.setToken(jwtToken);
saveTokenToLocalStorage({
- publicKey,
- encryptedPrivateKey,
- iv: encryptedPrivateKeyIV,
- tag: encryptedPrivateKeyTag,
- privateKey
+ publicKey,
+ encryptedPrivateKey,
+ iv: encryptedPrivateKeyIV,
+ tag: encryptedPrivateKeyTag,
+ privateKey
});
- const userOrgs = await fetchOrganizations();
+ const userOrgs = await fetchOrganizations();
const orgId = userOrgs[0]._id;
localStorage.setItem("orgData.id", orgId);
@@ -189,12 +178,12 @@ export default function SignupInvite() {
// Step 4 of the sign up process (download the emergency kit pdf)
const stepConfirmEmail = (
- <div className="border border-mineshaft-600 bg-mineshaft-800 flex flex-col items-center w-full max-w-xs md:max-w-lg h-7/12 py-8 px-4 md:px-6 mx-1 mb-36 md:mb-16 rounded-xl drop-shadow-xl">
- <p className="text-4xl text-center font-semibold mb-6 flex justify-center text-primary-100">
+ <div className="h-7/12 mx-1 mb-36 flex w-full max-w-xs flex-col items-center rounded-xl border border-mineshaft-600 bg-mineshaft-800 py-8 px-4 drop-shadow-xl md:mb-16 md:max-w-lg md:px-6">
+ <p className="mb-6 flex justify-center text-center text-4xl font-semibold text-primary-100">
Confirm your email
</p>
<Image src="/images/dragon-signupinvite.svg" height={262} width={410} alt="verify email" />
- <div className="flex flex-col items-center justify-center md:p-2 max-h-24 max-w-md mx-auto text-lg px-4 mt-10 mb-2">
+ <div className="mx-auto mt-10 mb-2 flex max-h-24 max-w-md flex-col items-center justify-center px-4 text-lg md:p-2">
<Button
text="Confirm Email"
onButtonPressed={async () => {
@@ -230,11 +219,11 @@ export default function SignupInvite() {
// Because this is the invite signup - we directly go to the last step of signup (email is already verified)
const main = (
- <div className="border border-mineshaft-600 bg-mineshaft-800 w-max mx-auto h-7/12 py-10 px-8 rounded-xl drop-shadow-xl mb-32 md:mb-16">
- <p className="text-4xl font-bold flex justify-center mb-6 mx-8 md:mx-16 text-transparent bg-clip-text bg-gradient-to-tr from-mineshaft-300 to-white">
+ <div className="h-7/12 mx-auto mb-32 w-max rounded-xl border border-mineshaft-600 bg-mineshaft-800 py-10 px-8 drop-shadow-xl md:mb-16">
+ <p className="mx-8 mb-6 flex justify-center bg-gradient-to-tr from-mineshaft-300 to-white bg-clip-text text-4xl font-bold text-transparent md:mx-16">
Almost there!
</p>
- <div className="relative z-0 flex items-center justify-end w-full md:p-2 rounded-lg max-h-24">
+ <div className="relative z-0 flex max-h-24 w-full items-center justify-end rounded-lg md:p-2">
<InputField
label="First Name"
onChangeHandler={setFirstName}
@@ -246,7 +235,7 @@ export default function SignupInvite() {
autoComplete="given-name"
/>
</div>
- <div className="flex items-center justify-center w-full md:p-2 rounded-lg max-h-24">
+ <div className="flex max-h-24 w-full items-center justify-center rounded-lg md:p-2">
<InputField
label="Last Name"
onChangeHandler={setLastName}
@@ -258,14 +247,13 @@ export default function SignupInvite() {
autoComplete="family-name"
/>
</div>
- <div className="mt-2 flex flex-col items-center justify-center w-full md:p-2 rounded-lg max-h-60">
+ <div className="mt-2 flex max-h-60 w-full flex-col items-center justify-center rounded-lg md:p-2">
<InputField
label="Password"
onChangeHandler={(pass) => {
setPassword(pass);
checkPassword({
password: pass,
- commonPasswords,
setErrors
});
}}
@@ -277,31 +265,26 @@ export default function SignupInvite() {
id="new-password"
/>
{Object.keys(errors).length > 0 && (
- <div className="mt-4 flex w-full flex-col items-start rounded-md bg-white/5 px-2 py-2">
- <div className="mb-2 text-sm text-gray-400">Password should contain at least:</div>
- {Object.keys(errors).map((key) => {
- if (errors[key as keyof Errors]) {
- return (
- <div className="ml-1 flex flex-row items-top justify-start" key={key}>
- <div>
- <FontAwesomeIcon
- icon={faXmark}
- className="text-md text-red ml-0.5 mr-2.5"
- />
- </div>
- <p className="text-gray-400 text-sm">
- {errors[key as keyof Errors]}
- </p>
+ <div className="mt-4 flex w-full flex-col items-start rounded-md bg-white/5 px-2 py-2">
+ <div className="mb-2 text-sm text-gray-400">Password should contain at least:</div>
+ {Object.keys(errors).map((key) => {
+ if (errors[key as keyof Errors]) {
+ return (
+ <div className="items-top ml-1 flex flex-row justify-start" key={key}>
+ <div>
+ <FontAwesomeIcon icon={faXmark} className="text-md ml-0.5 mr-2.5 text-red" />
</div>
- );
- }
+ <p className="text-sm text-gray-400">{errors[key as keyof Errors]}</p>
+ </div>
+ );
+ }
- return null;
- })}
- </div>
- )}
+ return null;
+ })}
+ </div>
+ )}
</div>
- <div className="flex flex-col items-center justify-center md:px-4 md:py-5 mt-2 px-2 py-3 max-h-24 max-w-max mx-auto text-lg">
+ <div className="mx-auto mt-2 flex max-h-24 max-w-max flex-col items-center justify-center px-2 py-3 text-lg md:px-4 md:py-5">
<Button
text="Sign Up"
onButtonPressed={() => {
@@ -316,21 +299,21 @@ export default function SignupInvite() {
// Step 4 of the sign up process (download the emergency kit pdf)
const step4 = (
- <div className="border border-mineshaft-600 bg-mineshaft-800 flex flex-col items-center w-full max-w-xs md:max-w-lg h-7/12 pt-8 pb-6 px-4 md:px-6 mx-1 mb-36 md:mb-16 rounded-xl drop-shadow-xl">
- <p className="text-4xl text-center font-semibold flex justify-center text-transparent bg-clip-text bg-gradient-to-br from-white to-mineshaft-300">
+ <div className="h-7/12 mx-1 mb-36 flex w-full max-w-xs flex-col items-center rounded-xl border border-mineshaft-600 bg-mineshaft-800 px-4 pt-8 pb-6 drop-shadow-xl md:mb-16 md:max-w-lg md:px-6">
+ <p className="flex justify-center bg-gradient-to-br from-white to-mineshaft-300 bg-clip-text text-center text-4xl font-semibold text-transparent">
Save your Emergency Kit
</p>
- <div className="flex flex-col items-center justify-center w-full mt-4 md:mt-8 max-w-md text-gray-400 text-md rounded-md px-2">
+ <div className="text-md mt-4 flex w-full max-w-md flex-col items-center justify-center rounded-md px-2 text-gray-400 md:mt-8">
<div>
If you get locked out of your account, your Emergency Kit is the only way to sign in.
</div>
<div className="mt-3">We recommend you download it and keep it somewhere safe.</div>
</div>
- <div className="w-full p-2 flex flex-row items-center bg-white/10 text-gray-400 rounded-md max-w-xs md:max-w-md mx-auto mt-4">
+ <div className="mx-auto mt-4 flex w-full max-w-xs flex-row items-center rounded-md bg-white/10 p-2 text-gray-400 md:max-w-md">
<FontAwesomeIcon icon={faWarning} className="ml-2 mr-4 text-4xl" />
It contains your Secret Key which we cannot access or recover for you if you lose it.
</div>
- <div className="flex flex-col items-center justify-center md:px-4 md:py-5 mt-4 px-2 py-3 max-h-24 max-w-max mx-auto text-lg">
+ <div className="mx-auto mt-4 flex max-h-24 max-w-max flex-col items-center justify-center px-2 py-3 text-lg md:px-4 md:py-5">
<Button
text="Download PDF"
onButtonPressed={async () => {
@@ -350,7 +333,7 @@ export default function SignupInvite() {
);
return (
- <div className="bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700 h-screen flex flex-col items-center justify-center">
+ <div className="flex h-screen flex-col items-center justify-center bg-gradient-to-tr from-mineshaft-600 via-mineshaft-800 to-bunker-700">
<Head>
<title>Sign Up</title>
<link rel="icon" href="/infisical.ico" />
diff --git a/frontend/src/views/Settings/PersonalSettingsPage/ChangePasswordSection/ChangePasswordSection.tsx b/frontend/src/views/Settings/PersonalSettingsPage/ChangePasswordSection/ChangePasswordSection.tsx
index 725fb0e47e..680b0fdbcb 100644
--- a/frontend/src/views/Settings/PersonalSettingsPage/ChangePasswordSection/ChangePasswordSection.tsx
+++ b/frontend/src/views/Settings/PersonalSettingsPage/ChangePasswordSection/ChangePasswordSection.tsx
@@ -11,7 +11,6 @@ import attemptChangePassword from "@app/components/utilities/attemptChangePasswo
import checkPassword from "@app/components/utilities/checks/checkPassword";
import { Button, FormControl, Input } from "@app/components/v2";
import { useUser } from "@app/context";
-import { useGetCommonPasswords } from "@app/hooks/api";
type Errors = {
tooShort?: string;
@@ -22,7 +21,6 @@ type Errors = {
specialChar?: string;
repeatedChar?: string;
isBreachedPassword?: string;
- isCommonPassword?: string;
};
const schema = yup
@@ -38,7 +36,6 @@ export const ChangePasswordSection = () => {
const { t } = useTranslation();
const { createNotification } = useNotificationContext();
const { user } = useUser();
- const { data: commonPasswords } = useGetCommonPasswords();
const { reset, control, handleSubmit } = useForm({
defaultValues: {
oldPassword: "",
@@ -52,11 +49,9 @@ export const ChangePasswordSection = () => {
const onFormSubmit = async ({ oldPassword, newPassword }: FormData) => {
try {
if (!user?.email) return;
- if (!commonPasswords) return;
const errorCheck = await checkPassword({
password: newPassword,
- commonPasswords,
setErrors
});
diff --git a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
index f142a2bef0..493d2b0cc7 100644
--- a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
+++ b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
@@ -15,7 +15,6 @@ import { deriveArgonKey } from "@app/components/utilities/cryptography/crypto";
import { saveTokenToLocalStorage } from "@app/components/utilities/saveTokenToLocalStorage";
import SecurityClient from "@app/components/utilities/SecurityClient";
import { Button, Input } from "@app/components/v2";
-import { useGetCommonPasswords } from "@app/hooks/api";
import { completeAccountSignup } from "@app/hooks/api/auth/queries";
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
import ProjectService from "@app/services/ProjectService";
@@ -42,7 +41,6 @@ type Errors = {
specialChar?: string;
repeatedChar?: string;
isBeachedPassword?: string;
- isCommonPassword?: string;
};
/**
@@ -67,7 +65,6 @@ export const UserInfoSSOStep = ({
setStep,
providerAuthToken
}: Props) => {
- const { data: commonPasswords } = useGetCommonPasswords();
const [nameError, setNameError] = useState(false);
const [organizationName, setOrganizationName] = useState("");
const [organizationNameError, setOrganizationNameError] = useState(false);
@@ -102,7 +99,6 @@ export const UserInfoSSOStep = ({
errorCheck = await checkPassword({
password,
- commonPasswords,
setErrors
});
@@ -277,7 +273,6 @@ export const UserInfoSSOStep = ({
setPassword(pass);
await checkPassword({
password: pass,
- commonPasswords,
setErrors
});
}}