rudimentary support for totp 2fa
[squeep-authentication-module] / lib / template / ia-html.js
index 00e2089338759627d26ace5ca8e8eeee2354ddcd..5de476ae04b880d2d94e6e3b1bd3db359aee2095 100644 (file)
@@ -2,6 +2,10 @@
 
 const { TemplateHelper: th } = require('@squeep/html-template-helper');
 
+/**
+ *
+ * @returns {String}
+ */
 function mainContent() {
   return [
     `<section>
@@ -31,7 +35,7 @@ module.exports = (ctx, options) => {
     ],
   };
   // Ensure there is always an error to report, even if we do not have one, as we ended up here somehow.
-  if (!ctx.errors || !ctx.errors.length) {
+  if (!ctx?.errors?.length) {
     ctx.errors = [
       'Unknown Error &mdash; we are not sure what just happened',
     ];