Updates
This commit is contained in:
@@ -35,6 +35,7 @@ type Param = {
|
||||
skipWriteAuthFile?: boolean;
|
||||
apiUserID?: string | number;
|
||||
dbUserId?: string | number;
|
||||
cleanupTokens?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -58,6 +59,7 @@ export default async function loginUser({
|
||||
skipWriteAuthFile,
|
||||
dbUserId,
|
||||
debug,
|
||||
cleanupTokens,
|
||||
}: Param): Promise<APILoginFunctionReturn> {
|
||||
const grabedHostNames = grabHostNames({ userId: user_id || apiUserID });
|
||||
const { host, port, scheme } = grabedHostNames;
|
||||
@@ -244,7 +246,10 @@ export default async function loginUser({
|
||||
if (httpResponse.csrf && !skipWriteAuthFile) {
|
||||
writeAuthFile(
|
||||
httpResponse.csrf,
|
||||
JSON.stringify(httpResponse.payload)
|
||||
JSON.stringify(httpResponse.payload),
|
||||
cleanupTokens && httpResponse.payload?.id
|
||||
? { userId: httpResponse.payload.id }
|
||||
: undefined
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user