|
@ -6,15 +6,14 @@ export default defineEventHandler(async (event) => { |
|
|
// if no password is required, the API should never be called.
|
|
|
// if no password is required, the API should never be called.
|
|
|
// Do not automatically authenticate the user.
|
|
|
// Do not automatically authenticate the user.
|
|
|
throw createError({ |
|
|
throw createError({ |
|
|
status: 401, |
|
|
statusCode: 401, |
|
|
message: 'Invalid state', |
|
|
statusMessage: 'Invalid state', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!isPasswordValid(password)) { |
|
|
if (!isPasswordValid(password)) { |
|
|
throw createError({ |
|
|
throw createError({ |
|
|
status: 401, |
|
|
statusCode: 401, |
|
|
message: 'Incorrect Password', |
|
|
statusMessage: 'Incorrect Password', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|