2024-11-05 11:12:42 +00:00
"use strict" ;
( ( ) => {
var exports = { } ;
exports . id = 3851 ;
exports . ids = [ 3851 ] ;
exports . modules = {
/***/ 1725 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
"SendPassResetContext" : ( ) => ( /* binding */ SendPassResetContext ) ,
"default" : ( ) => ( /* binding */ SendPasswordResetLinkPage ) ,
"getServerSideProps" : ( ) => ( /* binding */ getServerSideProps )
} ) ;
// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx _runtime _ = _ _webpack _require _ _ ( 997 ) ;
// EXTERNAL MODULE: external "react"
var external _react _ = _ _webpack _require _ _ ( 6689 ) ;
var external _react _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _react _ ) ;
// EXTERNAL MODULE: ./layouts/GeneralLayout.jsx + 1 modules
var GeneralLayout = _ _webpack _require _ _ ( 6217 ) ;
// EXTERNAL MODULE: ./components/general/PageHeadTags.jsx
var PageHeadTags = _ _webpack _require _ _ ( 4097 ) ;
// EXTERNAL MODULE: ./components/general/LoadingBlock.jsx
var LoadingBlock = _ _webpack _require _ _ ( 5264 ) ;
// EXTERNAL MODULE: ./functions/backend/userAuth.js
var userAuth = _ _webpack _require _ _ ( 370 ) ;
var userAuth _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( userAuth ) ;
// EXTERNAL MODULE: ./functions/frontend/fetchApi.js
var fetchApi = _ _webpack _require _ _ ( 6729 ) ;
// EXTERNAL MODULE: ./components/general/FormSuccessBlock.jsx
var FormSuccessBlock = _ _webpack _require _ _ ( 2186 ) ;
; // CONCATENATED MODULE: external "@mui/icons-material/InfoTwoTone"
const InfoTwoTone _namespaceObject = require ( "@mui/icons-material/InfoTwoTone" ) ;
var InfoTwoTone _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( InfoTwoTone _namespaceObject ) ;
; // CONCATENATED MODULE: ./components/general/InfoBlock.jsx
// @ts-check
/ * *
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* Imports
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* /
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ / * *
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* Main Component { Functional }
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* @ param { Object } props - Server props
* @ param { string } props . message
* / f u n c t i o n I n f o B l o c k ( { m e s s a g e } ) {
return /*#__PURE__*/ ( 0 , jsx _runtime _ . jsxs ) ( "div" , {
className : "info gray" ,
children : [
/*#__PURE__*/ jsx _runtime _ . jsx ( ( InfoTwoTone _default ( ) ) , {
fontSize : "small" ,
color : "inherit" ,
className : "opacity-50 text-gray-600"
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( "span" , {
className : "font-normal" ,
children : message
} )
]
} ) ;
} /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */
; // CONCATENATED MODULE: ./pages/send-password-reset-link.jsx
// @ts-check
/ * *
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* Imports
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* /
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
/** ****************************************************************************** */ /** @type {{ user: import("@/package-shared/types").UserType | null }} */ // @ts-ignore
const init = { } ;
const SendPassResetContext = /*#__PURE__*/ external _react _default ( ) . createContext ( init ) ;
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ / * *
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* Main Component { Functional }
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* @ param { Object } props - Server props
* @ param { import ( "@/package-shared/types" ) . UserType } props . user
* / f u n c t i o n S e n d P a s s w o r d R e s e t L i n k P a g e ( p r o p s ) {
/ * *
* Get Contexts
*
* @ abstract { React . useContext }
* / / ///////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
/ * *
* Javascript Variables
*
* @ abstract Non hook variables and functions
* / c o n s t p a g e T i t l e = " C l o u d b a s e d S Q L d a t a m a n a g e m e n t s y s t e m | D a t a s q u i r e l " ;
const pageDescription = "Datasquirel is a fast and efficient cloud-based SQL data management system that takes away the entire hassle of dealing with data both locally and across different platforms." ;
let head = /*#__PURE__*/ ( 0 , jsx _runtime _ . jsxs ) ( jsx _runtime _ . Fragment , {
children : [
/*#__PURE__*/ jsx _runtime _ . jsx ( "title" , {
children : pageTitle
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( "meta" , {
name : "description" ,
content : pageDescription
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( PageHeadTags /* default */ . Z , {
pageTitle : pageTitle ,
pageDescription : pageDescription ,
pagePathname : "/"
} )
]
} ) ;
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
/ * *
* React Hooks
*
* @ abstract { useState , useEffect , useRef , etc ... }
* / c o n s t [ l o a d i n g , s e t L o a d i n g ] = e x t e r n a l _ r e a c t _ d e f a u l t ( ) . u s e S t a t e ( f a l s e ) ;
const [ emailSent , setEmailSent ] = external _react _default ( ) . useState ( false ) ;
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
/ * *
* Function Return
*
* @ abstract Main Function Return
* / return / * # _ _PURE _ _ * / jsx_runtime_.jsx(GeneralLayout/ * default * / . Z , {
head : head ,
user : props . user ,
children : /*#__PURE__*/ jsx _runtime _ . jsx ( SendPassResetContext . Provider , {
value : {
user : props . user
} ,
children : /*#__PURE__*/ jsx _runtime _ . jsx ( "main" , {
children : /*#__PURE__*/ ( 0 , jsx _runtime _ . jsxs ) ( "section" , {
children : [
loading && /*#__PURE__*/ jsx _runtime _ . jsx ( LoadingBlock /* default */ . Z , { } ) ,
emailSent ? /*#__PURE__*/ jsx _runtime _ . jsx ( FormSuccessBlock /* default */ . Z , {
message : "Email Sent. Please check your email address and follow the link provided" ,
className : "whitespace-nowrap"
} ) : /*#__PURE__*/ jsx _runtime _ . jsx ( "div" , {
className : "paper" ,
children : /*#__PURE__*/ ( 0 , jsx _runtime _ . jsxs ) ( "div" , {
className : "max-w-xl flex-col items-stretch" ,
children : [
/*#__PURE__*/ jsx _runtime _ . jsx ( "h1" , {
className : "m-0 text-4xl" ,
children : "Send Password Reset Link"
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( "span" , {
children : "Please enter your email address to receive a password reset link"
} ) ,
/*#__PURE__*/ ( 0 , jsx _runtime _ . jsxs ) ( "form" , {
className : "w-full flex flex-col items-stretch gap-4" ,
onSubmit : ( e ) => {
setLoading ( true ) ;
e . preventDefault ( ) ;
/** @type {HTMLFormElement} */ // @ts-ignore
const formEl = e . target ;
const email = formEl [ "email-address" ] . value ;
( 0 , fetchApi /* default */ . Z ) ( ` /api/sendPasswordResetLink?email= ${ email } ` ) . then ( ( res ) => {
console . log ( res ) ;
setTimeout ( ( ) => {
setLoading ( false ) ;
} , 500 ) ;
if ( res . success ) {
setEmailSent ( true ) ;
}
} ) ;
} ,
children : [
/*#__PURE__*/ jsx _runtime _ . jsx ( "input" , {
type : "text" ,
autoComplete : "email" ,
name : "email-address" ,
id : "email-address" ,
className : "w-full" ,
placeholder : "Email Address" ,
defaultValue : props ? . user ? . logged _in _status ? props . user . email : "" ,
required : true
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( "button" , {
children : "Send password reset Email"
} ) ,
/*#__PURE__*/ jsx _runtime _ . jsx ( InfoBlock , {
message : "Please note that this link will expire after 1 hour"
} )
]
} )
]
} )
} )
]
} )
} )
} )
} ) ;
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
}
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ / * *
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* Server Side Props or Static Props
* === === === === === === === === === === === === === === === === === === === === === === === === === ===
* @ type { import ( "next" ) . GetServerSideProps }
* / a s y n c f u n c t i o n g e t S e r v e r S i d e P r o p s ( { r e q , r e s } ) {
/ * *
* User Auth
*
* @ description User Auth
* / c o n s t u s e r = a w a i t u s e r A u t h _ d e f a u l t ( ) ( r e q , r e s ) ;
if ( user ? . social _login ) {
return {
redirect : {
destination : "/" ,
permanent : false
}
} ;
}
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
/ * *
* Server props return
*
* @ description Return data fetched on the server side
* / r e t u r n {
props : {
user : user
}
} ;
////////////////////////////////////////
////////////////////////////////////////
////////////////////////////////////////
}
/***/ } ) ,
/***/ 386 :
/***/ ( ( module ) => {
module . exports = require ( "@mui/icons-material/CottageTwoTone" ) ;
/***/ } ) ,
/***/ 5557 :
/***/ ( ( module ) => {
module . exports = require ( "@mui/icons-material/MenuBookTwoTone" ) ;
/***/ } ) ,
/***/ 2423 :
/***/ ( ( module ) => {
module . exports = require ( "lucide-react" ) ;
/***/ } ) ,
/***/ 968 :
/***/ ( ( module ) => {
module . exports = require ( "next/head" ) ;
/***/ } ) ,
/***/ 6689 :
/***/ ( ( module ) => {
module . exports = require ( "react" ) ;
/***/ } ) ,
/***/ 997 :
/***/ ( ( module ) => {
module . exports = require ( "react/jsx-runtime" ) ;
/***/ } ) ,
/***/ 2261 :
/***/ ( ( module ) => {
module . exports = require ( "serverless-mysql" ) ;
/***/ } ) ,
/***/ 4300 :
/***/ ( ( module ) => {
module . exports = require ( "buffer" ) ;
/***/ } ) ,
/***/ 6113 :
/***/ ( ( module ) => {
module . exports = require ( "crypto" ) ;
/***/ } ) ,
/***/ 7147 :
/***/ ( ( module ) => {
module . exports = require ( "fs" ) ;
/***/ } ) ,
/***/ 3685 :
/***/ ( ( module ) => {
module . exports = require ( "http" ) ;
/***/ } ) ,
/***/ 1017 :
/***/ ( ( module ) => {
module . exports = require ( "path" ) ;
/***/ } )
} ;
;
// load runtime
var _ _webpack _require _ _ = require ( "../webpack-runtime.js" ) ;
_ _webpack _require _ _ . C ( exports ) ;
var _ _webpack _exec _ _ = ( moduleId ) => ( _ _webpack _require _ _ ( _ _webpack _require _ _ . s = moduleId ) )
2024-11-05 14:18:40 +00:00
var _ _webpack _exports _ _ = _ _webpack _require _ _ . X ( 0 , [ 4017 , 8313 , 5264 , 6729 , 5449 , 913 , 4480 , 370 , 9360 , 6217 , 4097 , 2186 ] , ( ) => ( _ _webpack _exec _ _ ( 1725 ) ) ) ;
2024-11-05 11:12:42 +00:00
module . exports = _ _webpack _exports _ _ ;
} ) ( ) ;