Skip to content

Commit

Permalink
Merge pull request #69 from Rituraj67/master
Browse files Browse the repository at this point in the history
sign up
  • Loading branch information
imdeveshshukla authored Sep 9, 2024
2 parents 7492cb9 + be9f25c commit d89a7c2
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 287 deletions.
11 changes: 7 additions & 4 deletions backend/src/controller/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ const signup = async (req, res) => {
},
});
let newUser;
if ((isuser && isuser.isVarified)|| (isuser && !isuser.isVarified && isuser.email!=email)) {
// || (isuser && !isuser.isVarified && isuser.email!=email)
if ((isuser && isuser.isVarified)) {
res.status(400).json({ res: "User Already Exists" });
return;
} else if (isuser && !isuser.isVarified && isuser.email==email) {
} else if (isuser) {
newUser = await prisma.user.update({
where:{
username: isuser.username
},
data:{
username,
email,
password: hashPass,
}
})
Expand Down Expand Up @@ -163,7 +165,7 @@ const varifyOtp = async (req, res) => {
}
const { userID, otp, email } = req.body;
if (userID == "" || otp == "") {
throw Error(" credetials cannot be empty");
return res.status(401).json({ msg: "Invalid Otp" });
} else {
const varData = await prisma.userVarify.findUnique({
where: { userID: userID },
Expand Down Expand Up @@ -226,7 +228,8 @@ const varifyOtp = async (req, res) => {
};

const resendOtp = async (req, res) => {
// console.log(req.body);
console.log(req.body);

try {
await sendEmailVarification(req.body, res);
} catch (error) {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/utils/generateUsernames.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import prisma from "../../db/db.config.js";


function generateRandomUsername() {
console.log(Math.floor(Math.random() * usernames.length));

const randomWord = usernames[Math.floor(Math.random() * usernames.length)];
const randomNumber = Math.floor(1000 + Math.random() * 9000);
return `${randomWord}_${randomNumber}`;
Expand Down
337 changes: 95 additions & 242 deletions backend/src/utils/usernames.js
Original file line number Diff line number Diff line change
@@ -1,247 +1,100 @@

const usernames= [
"OwlsNight",
"EarlyBird",
"CoolCoder",
"CoderGirl",
"OwlEyes",
"CoolGamer",
"EarlyRiser",
"CoolCrafter",
"CoderLife",
"OwlWings",
"EarlyPeek",
"CoolVibes",
"CoderMagic",
"OwlWhisper",
"EarlyGlow",
"CoolChic",
"CoderSwag",
"OwlDreams",
"CoolMinded",
"JavaWizard",
"PythonPanda",
"AnimeFanatic",
"GamerGuru",
"MemeMaster",
"StarWarsNerd",
"HobbitFan",
"CodeSamurai",
"MangaManiac",
"PixelPioneer",
"RetroGamer",
"FunkyFeline",
"QuirkyQuokka",
"TechTitan",
"AstroNerd",
"EpicEngineer",
"MatrixMaven",
"NinjaCoder",
"DragonSlayer",
"GokuFan",
"NarutoNerd",
"OnePieceGuru",
"SpaceCadet",
"TechieTurtle",
"CyberWizard",
"BinaryBoss",
"EpicCoder",
"FunkyFrog",
"CodeCrafter",
"AstroAce",
"PixelProwler",
"MatrixMogul",
"CodeKing",
"AnimeAce",
"RetroRebel",
"DragonMaster",
"TechieTiger",
"MemeLord",
"CoderCrusader",
"AnimeHero",
"GamerGeek",
"AstroGamer",
"PixelProdigy",
"CodeKnight",
"NinjaWarrior",
"DragonQueen",
"FunkyMonkey",
"MatrixMaster",
"AstroAlien",
"DragonWarrior",
"PixelPhantom",
"MatrixMagician",
"RetroRaider",
"GokuGamer",
"MemeMaven",
"SpaceSage",
"DragonDiva",
"CodeWizard",
"AstroArtist",
"AnimeNinja",
"FunkyFox",
"GamerGoddess",
"PixelPaladin",
"MatrixMonarch",
"TechieToad",
"RetroRogue",
"NinjaMaster",
"SpaceScout",
"BinaryMaster",
"DragonKnight",
"CodeGuru",
"AstroAdventurer",
"AnimeChampion",
"FunkyFerret",
"GamerGenius",
"PixelProtector",
"MatrixMentor",
"TechieTyrant",
"ForestNinja",
"CyberForest",
"ProForest",
"MasterForest",
"LegendForest",
"ForestQueen",
"ForestKing",
"OceanNinja",
"CyberOcean",
"ProOcean",
"MasterOcean",
"LegendOcean",
"OceanQueen",
"OceanKing",
"MountainNinja",
"CyberMountain",
"ProMountain",
"MasterMountain",
"LegendMountain",
"MountainQueen",
"MountainKing",
"SkyNinja",
"CyberSky",
"ProSky",
"MasterSky",
"LegendSky",
"SkyQueen",
"SkyKing",
"EarthNinja",
"CyberEarth",
"ProEarth",
"MasterEarth",
"LegendEarth",
"EarthQueen",
"EarthKing",
"CodeNinja",
"CyberCode",
"ProCode",
"MasterCode",
"LegendCode",
"CodeQueen",
"CodeKing",
"PixelNinja",
"CyberPixel",
"ProPixel",
"MasterPixel",
"LegendPixel",
"PixelQueen",
"PixelKing",
"ByteNinja",
"CyberByte",
"ProByte",
"MasterByte",
"LegendByte",
"ByteQueen",
"ByteKing",
"NetworkNinja",
"CyberNetwork",
"ProNetwork",
"MasterNetwork",
"LegendNetwork",
"NetworkQueen",
"NetworkKing",
"DigitalNinja",
"CyberDigital",
"ProDigital",
"MasterDigital",
"LegendDigital",
"DigitalQueen",
"DigitalKing",
"LevelNinja",
"CyberLevel",
"ProLevel",
"MasterLevel",
"LegendLevel",
"LevelQueen",
"LevelKing",
"QuestNinja",
"CyberQuest",
"ProQuest",
"MasterQuest",
"LegendQuest",
"QuestQueen",
"QuestKing",
"AvatarNinja",
"CyberAvatar",
"ProAvatar",
"MasterAvatar",
"LegendAvatar",
"AvatarQueen",
"AvatarKing",
"ClanNinja",
"CyberClan",
"ProClan",
"MasterClan",
"LegendClan",
"ClanQueen",
"ClanKing",
"SolarWind",
"AquaStorm",
"IronKnight",
"CrystalHawk",
"GoldenSun",
"ThunderBolt",
"MysticMoon",
"FrostDragon",
"EmeraldWave",
"ShadowFury",
"BlazeStar",
"EchoSpirit",
"VortexRider",
"RagingLion",
"LunarEcho",
"AuroraGaze",
"TempestShade",
"CelestialFire",
"StellarDream",
"NebulaGuard",
"PhantomFrost",
"ZephyrSky",
"InfernoPulse",
"QuantumFlame",
"RadiantStorm",
"NovaStrike",
"EclipseKnight",
"NebulaSword",
"PhoenixGlow",
"ObsidianFlash",
"AuroraShine",
"BlizzardKnight",
"RadiantGlory",
"SolarBlaze",
"VortexFlame",
"ShadowEcho",
"TitanStorm",
"CelestialFury",
"LunarShade",
"NebulaStorm",
"StellarPulse",
"TempestFire",
"QuantumBurst",
"PhantomStrike",
"InfernoGuard",
"EchoWave",
"VortexGaze"
"CodeNinja", "PixelHunter", "TechWizard", "ByteWarrior", "CodeMancer",
"DataSamurai", "CryptoKnight", "ScriptHero", "AlgoMaster", "CloudRider",
"FitTitan", "DevTitan", "CyberMonk", "DataFighter", "PixelMage",
"CodeBlade", "LuffyLeader", "DebugWarrior", "BotSlayer", "NarutoNinja",
"NeoHacker", "ByteBreaker", "AlgoDragon", "CryptoLancer", "ScriptSage",
"FitLancer", "BitNinja", "TechShadow", "CodeLancer", "PixelKnight",
"ByteWizard", "DevSamurai", "ManagementMaster", "DataLancer", "GokuGlory",
"FitHunter", "CodeStorm", "DebugSlinger", "CyberRogue", "ZoroWarrior",
"AlgoRider", "ScriptMage", "CryptoWizard", "ByteHero", "CloudKnight",
"FitRider", "DataNinja", "PixelStorm", "CodeSamurai", "AlgoHunter",
"ByteMonk", "DebugSage", "BotWarrior", "NeoLancer", "CodeSlinger",
"ByteRogue", "CyberMaster", "AlgoMonk", "FitMage", "ScriptStorm",
"DataMage", "TechFury", "CloudDragon", "FitSlayer", "DevSlayer",
"PixelBreaker", "BitStorm", "CodeShadow", "DebugHunter", "AlgoKnight",
"ScriptLancer", "DataBlade", "BotNinja", "CryptoRider", "ByteWarlock",
"CodeFury", "CyberMage", "PixelWizard", "TechTitan", "AlgoSamurai",
"ScriptBreaker", "DataKnight", "DebugDragon", "BotMage", "NeoSlinger",
"CloudHero", "ByteRider", "CodeMonk", "CryptoSamurai", "ScriptSlayer",
"TechMaster", "AlgoBlade", "PixelSlinger", "DataStorm", "DebugWarlock",
"CodeSlayer", "BitKnight", "CloudSlayer", "ScriptFury", "FitStorm",
"AlgoWizard", "BotStorm", "PixelHunter", "ByteKnight", "DevWizard",
"DataStormer", "CloudBreaker", "LeviSlayer", "CodeMonarch", "AlgoSlinger",
"CryptoBreaker", "ByteSamurai", "DebugKnight", "BotShadow", "NeoStormer",
"CodeHunter", "CyberBlade", "FitMaster", "AlgoMaster", "ScriptKnight",
"PixelStormer", "DataFury", "BotRider", "CodeLancer", "ByteStormer",
"DebugMage", "CloudSamurai", "PixelBreaker", "TechSlayer", "AlgoFury",
"DataShadow", "CodeStormer", "ByteDragon", "ScriptRider", "CyberWarrior",
"DevMage", "PixelMonk", "CryptoHunter", "BotSlinger", "DebugBlade",
"AlgoSlayer", "ScriptWarlock", "FitWarrior", "CodeTitan", "ByteShadow",
"CyberDragon", "DataSlayer", "PixelRogue", "CodeWarlock", "AlgoBreaker",
"BotKnight", "ByteMage", "ScriptSlayer", "DebugRogue", "NeoSamurai",
"CryptoMonk", "AlgoHunter", "ByteSage", "DataKnight", "PixelRider",
"BotSlayer", "ScriptDragon", "AlgoMonarch", "CloudLancer", "CodeHunter",
"DebugMage", "ByteStormer", "CyberSlinger", "BotMaster", "ScriptFury",
"TechRider", "PixelMonarch", "AlgoSamurai", "CloudKnight", "CodeWarlock",
"ByteMaster", "CryptoMonarch", "BotFury", "DebugRider", "AlgoStorm",
"CloudMaster", "DataWarlock", "CodeSlinger", "ByteLancer", "PixelShadow",
"ScriptMonk", "DebugSlayer", "AlgoMaster", "CyberBreaker", "BotKnight",
"ByteTitan", "DataMage", "ScriptHunter", "CodeShadow", "CloudRogue",
"DebugMonk", "AlgoWarrior", "PixelMage", "ByteWarlock", "CyberHunter",
"BotStorm", "DataSlayer", "ScriptMaster", "NeoBreaker", "CodeKnight",
"ByteWarrior", "DebugMaster", "AlgoSage", "CyberDragon", "PixelSlayer",
"ScriptWarlock", "BotRogue", "CloudSage", "CodeSage", "ByteDragon",
"DataRogue", "DebugFury", "AlgoSlinger", "CryptoMonarch", "PixelSage",
"CodeMaster", "ByteBreaker", "TechMonarch", "CloudStorm", "BotMaster",
"DataRider", "AlgoSlayer", "PixelHunter", "ScriptTitan", "DebugMonarch",
"CloudSlayer", "CodeRogue", "ByteSlinger", "CyberSlayer", "DataWarrior",
"BotRider", "DebugTitan", "AlgoWarlock", "CryptoSlayer", "CodeMage",
"ByteSage", "TechMonk", "PixelWarrior", "BotHunter", "CloudRider",
"ScriptSamurai", "DebugBreaker", "AlgoWarrior", "CodeBreaker",
"ByteKnight", "DataStorm", "BotSamurai", "CyberWarrior", "DebugSlinger",
"AlgoStorm", "CryptoFury", "PixelBreaker", "CodeLancer", "ByteSlayer",
"CloudWarrior", "TechMonarch", "AlgoDragon", "BotMage", "DebugSlayer",
"ByteSlinger", "CyberBreaker", "ScriptHunter", "DataTitan", "PixelSamurai",
"CodeStormer", "ByteShadow", "CloudMage", "AlgoRogue", "DebugWarrior",
"CryptoSlinger", "BotShadow", "ByteDragon", "PixelStormer", "CodeMonk",
"DataWarlock", "ScriptSage", "CyberLancer", "AlgoMage", "ByteStorm",
"TechWarrior", "BotMonarch", "DebugFury", "PixelWarlock", "CodeWarrior",
"AlgoSlayer", "ByteKnight", "CryptoTitan", "CloudHunter", "BotSage",
"ScriptDragon", "DebugMaster", "AlgoStormer", "CodeKnight", "ByteFury",
"TechWarlock", "CyberStorm", "PixelMonk", "BotTitan", "DataMage",
"ScriptSlinger", "DebugStorm", "CloudSlayer", "ByteWarlock", "AlgoMonarch",
"CodeTitan", "PixelKnight", "CryptoWarlock", "OwlsNight", "EarlyBird",
"CoolCoder", "CoderGirl", "OwlEyes", "CoolGamer", "EarlyRiser",
"CoolCrafter", "CoderLife", "OwlWings", "EarlyPeek", "CoolVibes",
"CoderMagic", "OwlWhisper", "EarlyGlow", "CoolChic", "CoderSwag",
"OwlDreams", "CoolMinded", "JavaWizard", "PythonPanda", "AnimeFanatic",
"GamerGuru", "MemeMaster", "StarWarsNerd", "HobbitFan", "CodeSamurai",
"MangaManiac", "PixelPioneer", "RetroGamer", "FunkyFeline", "QuirkyQuokka",
"TechTitan", "AstroNerd", "EpicEngineer", "MatrixMaven", "NinjaCoder",
"DragonSlayer", "GokuFan", "NarutoNerd", "OnePieceGuru", "SpaceCadet",
"TechieTurtle", "CyberWizard", "BinaryBoss", "EpicCoder", "FunkyFrog",
"CodeCrafter", "AstroAce", "PixelProwler", "MatrixMogul", "CodeKing",
"AnimeAce", "RetroRebel", "DragonMaster", "TechieTiger", "MemeLord",
"CoderCrusader", "AnimeHero", "GamerGeek", "AstroGamer", "PixelProdigy",
"CodeKnight", "NinjaWarrior", "DragonQueen", "FunkyMonkey", "MatrixMaster",
"AstroAlien", "DragonWarrior", "PixelPhantom", "MatrixMagician", "RetroRaider",
"GokuGamer", "MemeMaven", "SpaceSage", "DragonDiva", "CodeWizard",
"AstroArtist", "AnimeNinja", "FunkyFox", "GamerGoddess", "PixelPaladin",
"MatrixMonarch", "TechieToad", "RetroRogue", "NinjaMaster", "SpaceScout",
"BinaryMaster", "DragonKnight", "CodeGuru", "AstroAdventurer", "AnimeChampion",
"FunkyFerret", "GamerGenius", "PixelProtector", "MatrixMentor", "TechieTyrant",
"ForestNinja", "CyberForest", "ProForest", "MasterForest", "LegendForest",
"ForestQueen", "ForestMage", "ForestKnight", "ForestWarrior", "ForestDragon",
"ForestSage", "ForestHero", "ForestWanderer", "ForestWitch", "ForestTitan",
"ForestShaman", "ForestGuardian", "ForestSorcerer", "ForestPrince", "ForestRanger",
"ForestWarlock", "ForestPaladin", "ForestChampion", "ForestDruid", "ForestViking",
"ForestConqueror", "ForestTamer", "ForestSummoner", "ForestCrusader", "ForestMystic",
"ForestArtisan", "ForestProtector", "ForestSentinel", "ForestEnchanter", "ForestSquire",
"ForestBard", "ForestFighter", "ForestInvoker", "ForestSeer", "ForestPioneer",
"ForestTactician", "ForestGladiator", "ForestMonarch", "ForestChampion", "ForestWarden",
"ForestAlchemist", "ForestDemon", "ForestLord", "ForestVanguard", "ForestWarlord",
"ForestDrake", "ForestPriest", "ForestHunter", "ForestGiant", "ForestRuler",
"ForestMage", "ForestLord", "ForestSwordsman", "ForestGladiator", "ForestDemon"
];


export default usernames;
Loading

0 comments on commit d89a7c2

Please sign in to comment.