Skip to content

TypeScript API / @laikacms/server/oauth2 / oauthErrorResponse

Function: oauthErrorResponse() ​

ts
function oauthErrorResponse(
   error, 
   errorDescription?, 
   status?, 
   customLogo?, 
   goBackHref?, 
   msgs?
): Response;

Create an HTTP Response with the error page HTML

Parameters ​

ParameterTypeDefault value
errorstringundefined
errorDescription?stringundefined
status?number400
customLogo?stringundefined
goBackHref?stringundefined
msgs?{ auth: { authenticating: string; authenticationFailed: string; dividerOr: string; emailLabel: string; emailPlaceholder: string; forgotPasswordLink: string; loginButton: string; noCredentialReturned: string; pageTitle: string; passkeyAuthFailed: string; passkeyOptionsNotAvailable: string; passwordLabel: string; passwordPlaceholder: string; signInButton: string; signingInWithPasskey: string; signInWithPasskey: string; }; common: { back: string; cancel: string; continue: string; error: string; loading: string; submit: string; success: string; }; email: { passwordResetAction: string; passwordResetButton: string; passwordResetFooter: string; passwordResetGreeting: string; passwordResetIntro: string; passwordResetLinkHint: string; passwordResetSubject: string; passwordResetSupport: string; passwordResetTitle: string; passwordResetWarning: string; }; error: { defaultDescription: string; goBackButton: string; pageTitle: string; }; logout: { allDescription: string; allPageTitle: string; allTitle: string; backToLogin: string; description: string; pageTitle: string; title: string; }; passkey: { browserNotSupported: string; createButton: string; description: string; loadingPrompt: string; nameLabel: string; namePlaceholder: string; pageTitle: string; registrationFailed: string; setupFailed: string; skipLink: string; successDescription: string; successTitle: string; title: string; }; passwordReset: { backToLogin: string; checkEmailDescription: string; checkEmailPageTitle: string; checkEmailTitle: string; confirmPasswordLabel: string; confirmPasswordPlaceholder: string; enterEmailError: string; forgotDescription: string; forgotPageTitle: string; forgotTitle: string; linkExpiredError: string; newPasswordLabel: string; newPasswordPlaceholder: string; passwordHint: string; passwordMinLengthError: string; passwordMismatchError: string; resetButton: string; resetDescription: string; resetPageTitle: string; resetTitle: string; sendResetLink: string; signInLink: string; successDescription: string; successPageTitle: string; successTitle: string; }; totp: { description: string; enterVerificationCode: string; inputLabel: string; inputPlaceholder: string; manualKeyCopied: string; manualKeyLabel: string; pageTitle: string; qrCodeAlt: string; setupPageTitle: string; setupStep1: string; setupStep2: string; setupStep3: string; setupTitle: string; title: string; verifyAndContinue: string; verifyButton: string; }; }undefined
msgs.auth?{ authenticating: string; authenticationFailed: string; dividerOr: string; emailLabel: string; emailPlaceholder: string; forgotPasswordLink: string; loginButton: string; noCredentialReturned: string; pageTitle: string; passkeyAuthFailed: string; passkeyOptionsNotAvailable: string; passwordLabel: string; passwordPlaceholder: string; signInButton: string; signingInWithPasskey: string; signInWithPasskey: string; }...
msgs.auth.authenticating?string'Authenticating...'
msgs.auth.authenticationFailed?string'Authentication failed'
msgs.auth.dividerOr?string'or'
msgs.auth.emailLabel?string'Email'
msgs.auth.emailPlaceholder?string'Email'
msgs.auth.forgotPasswordLink?string'Forgot password?'
msgs.auth.loginButton?string'Login'
msgs.auth.noCredentialReturned?string'No credential returned'
msgs.auth.pageTitle?string'Sign In - Laika CMS'
msgs.auth.passkeyAuthFailed?string'Passkey authentication failed. Please try again or use password.'
msgs.auth.passkeyOptionsNotAvailable?string'Passkey options not available'
msgs.auth.passwordLabel?string'Password'
msgs.auth.passwordPlaceholder?string'Password'
msgs.auth.signInButton?string'Sign In'
msgs.auth.signingInWithPasskey?string'Signing in with passkey...'
msgs.auth.signInWithPasskey?string'Sign in with Passkey'
msgs.common?{ back: string; cancel: string; continue: string; error: string; loading: string; submit: string; success: string; }...
msgs.common.back?string'Back'
msgs.common.cancel?string'Cancel'
msgs.common.continue?string'Continue'
msgs.common.error?string'Error'
msgs.common.loading?string'Loading...'
msgs.common.submit?string'Submit'
msgs.common.success?string'Success'
msgs.email?{ passwordResetAction: string; passwordResetButton: string; passwordResetFooter: string; passwordResetGreeting: string; passwordResetIntro: string; passwordResetLinkHint: string; passwordResetSubject: string; passwordResetSupport: string; passwordResetTitle: string; passwordResetWarning: string; }...
msgs.email.passwordResetAction?string'Click the button below to reset your password:'
msgs.email.passwordResetButton?string'Reset Password'
msgs.email.passwordResetFooter?string'This email was sent by .'
msgs.email.passwordResetGreeting?string'Hi,'
msgs.email.passwordResetIntro?string'We received a request to reset the password for your account associated with <strong></strong>.'
msgs.email.passwordResetLinkHint?string'Or copy and paste this link into your browser:'
msgs.email.passwordResetSubject?string'Reset Your Password'
msgs.email.passwordResetSupport?string'If you have questions, contact'
msgs.email.passwordResetTitle?string'Reset Your Password'
msgs.email.passwordResetWarning?string"⚠️ This link will expire in <strong></strong>. If you didn't request a password reset, you can safely ignore this email."
msgs.error?{ defaultDescription: string; goBackButton: string; pageTitle: string; }...
msgs.error.defaultDescription?string'An error occurred during authentication.'
msgs.error.goBackButton?string'Go Back'
msgs.error.pageTitle?string'Error - '
msgs.logout?{ allDescription: string; allPageTitle: string; allTitle: string; backToLogin: string; description: string; pageTitle: string; title: string; }...
msgs.logout.allDescription?string'You have been successfully logged out of all your sessions on all devices.'
msgs.logout.allPageTitle?string'Logged Out Everywhere - Laika CMS'
msgs.logout.allTitle?string'Logged Out Everywhere'
msgs.logout.backToLogin?string'Back to login'
msgs.logout.description?string'You have been successfully logged out of your current session.'
msgs.logout.pageTitle?string'Logged Out - Laika CMS'
msgs.logout.title?string"You've Been Logged Out"
msgs.passkey?{ browserNotSupported: string; createButton: string; description: string; loadingPrompt: string; nameLabel: string; namePlaceholder: string; pageTitle: string; registrationFailed: string; setupFailed: string; skipLink: string; successDescription: string; successTitle: string; title: string; }...
msgs.passkey.browserNotSupported?string'Your browser does not support passkeys. Please use a modern browser like Chrome, Safari, or Firefox.'
msgs.passkey.createButton?string'Create Passkey'
msgs.passkey.description?string'Passkeys are a more secure and convenient way to sign in.'
msgs.passkey.loadingPrompt?string'Follow the prompts from your browser or device...'
msgs.passkey.nameLabel?string'Passkey Name (optional)'
msgs.passkey.namePlaceholder?string'e.g., MacBook Pro, iPhone'
msgs.passkey.pageTitle?string'Set Up Passkey - Laika CMS'
msgs.passkey.registrationFailed?string'Registration failed'
msgs.passkey.setupFailed?string'Failed to set up passkey. Please try again.'
msgs.passkey.skipLink?string'Skip for now'
msgs.passkey.successDescription?string'You can now use this passkey to sign in. Redirecting...'
msgs.passkey.successTitle?string'Passkey Created!'
msgs.passkey.title?string'Set Up a Passkey'
msgs.passwordReset?{ backToLogin: string; checkEmailDescription: string; checkEmailPageTitle: string; checkEmailTitle: string; confirmPasswordLabel: string; confirmPasswordPlaceholder: string; enterEmailError: string; forgotDescription: string; forgotPageTitle: string; forgotTitle: string; linkExpiredError: string; newPasswordLabel: string; newPasswordPlaceholder: string; passwordHint: string; passwordMinLengthError: string; passwordMismatchError: string; resetButton: string; resetDescription: string; resetPageTitle: string; resetTitle: string; sendResetLink: string; signInLink: string; successDescription: string; successPageTitle: string; successTitle: string; }...
msgs.passwordReset.backToLogin?string'Back to login'
msgs.passwordReset.checkEmailDescription?string"If an account exists with that email address, we've sent you a link to reset your password. Please check your inbox and spam folder."
msgs.passwordReset.checkEmailPageTitle?string'Check Your Email - Laika CMS'
msgs.passwordReset.checkEmailTitle?string'Check Your Email'
msgs.passwordReset.confirmPasswordLabel?string'Confirm Password'
msgs.passwordReset.confirmPasswordPlaceholder?string'Confirm new password'
msgs.passwordReset.enterEmailError?string'Please enter your email address'
msgs.passwordReset.forgotDescription?string"Enter your email address and we'll send you a link to reset your password."
msgs.passwordReset.forgotPageTitle?string'Forgot Password - Laika CMS'
msgs.passwordReset.forgotTitle?string'Forgot Password'
msgs.passwordReset.linkExpiredError?string'This reset link has expired or is invalid. Please request a new one.'
msgs.passwordReset.newPasswordLabel?string'New Password'
msgs.passwordReset.newPasswordPlaceholder?string'Enter new password'
msgs.passwordReset.passwordHint?string'Must be at least 8 characters'
msgs.passwordReset.passwordMinLengthError?string'Password must be at least 8 characters'
msgs.passwordReset.passwordMismatchError?string'Passwords do not match'
msgs.passwordReset.resetButton?string'Reset Password'
msgs.passwordReset.resetDescription?string'Enter your new password below.'
msgs.passwordReset.resetPageTitle?string'Reset Password - Laika CMS'
msgs.passwordReset.resetTitle?string'Reset Password'
msgs.passwordReset.sendResetLink?string'Send Reset Link'
msgs.passwordReset.signInLink?string'Sign in'
msgs.passwordReset.successDescription?string'Your password has been reset successfully. You can now sign in with your new password.'
msgs.passwordReset.successPageTitle?string'Password Reset Successful - Laika CMS'
msgs.passwordReset.successTitle?string'Password Reset Successful'
msgs.totp?{ description: string; enterVerificationCode: string; inputLabel: string; inputPlaceholder: string; manualKeyCopied: string; manualKeyLabel: string; pageTitle: string; qrCodeAlt: string; setupPageTitle: string; setupStep1: string; setupStep2: string; setupStep3: string; setupTitle: string; title: string; verifyAndContinue: string; verifyButton: string; }...
msgs.totp.description?string'Enter the 6-digit code from your authenticator app'
msgs.totp.enterVerificationCode?string'Enter verification code'
msgs.totp.inputLabel?string'One-time code'
msgs.totp.inputPlaceholder?string'000000'
msgs.totp.manualKeyCopied?string'Copied!'
msgs.totp.manualKeyLabel?string'Or enter this key manually:'
msgs.totp.pageTitle?string'Two-Factor Authentication - Laika CMS'
msgs.totp.qrCodeAlt?string'QR Code for '
msgs.totp.setupPageTitle?string'Set Up Two-Factor Authentication - Laika CMS'
msgs.totp.setupStep1?string'Download an authenticator app like Google Authenticator, Authy, or 1Password'
msgs.totp.setupStep2?string'Scan the QR code below or enter the key manually'
msgs.totp.setupStep3?string'Enter the 6-digit code to verify'
msgs.totp.setupTitle?string'Set Up Two-Factor Authentication'
msgs.totp.title?string'Two-Factor Authentication'
msgs.totp.verifyAndContinue?string'Verify & Continue'
msgs.totp.verifyButton?string'Verify'

Returns ​

Response

Released under the MIT License.