mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
DB: Removed need for password and added docs
This commit is contained in:
1 parent
2b52612f65
commit
c91d0729fb
3 files changed
+19
-12
No files matched your search
@@ -15,7 +15,7 @@ export function parseSemiColonFormat(connectionString: string): Map {
|
||||
const parts = connectionString.split(";");
|
||||
if (parts.length === 1) {
|
||||
throw new Error(
|
||||
`Connection string ${connectionString} is in the incorrect format.`
|
||||
`Connection string ${connectionString} is in the incorrect format. Please follow the README.`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -59,13 +59,12 @@ export function getUserId(config: Map): string {
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: We are allowing no password as many FiveM servers love to not use one for an ungodly reason.
|
||||
* allowed variable names: password | pwd
|
||||
* @param config - database config variables parsed from mysql_connection_string
|
||||
*/
|
||||
export function getPassword(config: Map): string {
|
||||
export function getPassword(config: Map): string | undefined {
|
||||
const password = config.password || config.pwd;
|
||||
if (!password) {
|
||||
throw new Error("Password is a required field");
|
||||
}
|
||||
if (!password) return undefined;
|
||||
return password;
|
||||
}
|
||||
Reference in new issue
Block a user