{"version":3,"sources":["webpack:///./node_modules/core-js/modules/es6.regexp.search.js","webpack:///./node_modules/core-js/modules/es6.function.name.js","webpack:///./node_modules/core-js/modules/_same-value.js","webpack:///./src/website/views/auth/Login.vue?d61e","webpack:///./src/website/views/auth/Login.vue","webpack:///./src/website/views/auth/Login.vue?8701","webpack:///./src/website/views/auth/Login.vue?8fd8","webpack:///./src/website/services/AuthService.ts"],"names":["anObject","sameValue","regExpExec","defined","SEARCH","$search","maybeCallNative","regexp","O","this","fn","undefined","call","RegExp","String","res","done","value","rx","S","previousLastIndex","lastIndex","result","index","dP","f","FProto","Function","prototype","nameRE","NAME","configurable","get","match","e","module","exports","Object","is","x","y","render","_vm","_h","$createElement","_c","_self","staticClass","_m","attrs","on","$event","preventDefault","onSubmit","_v","directives","name","rawName","user","expression","class","errors","has","domProps","target","composing","$set","_s","first","_e","any","submitted","loginWithGoogle","loginWithFacebook","staticStyle","staticRenderFns","generateRandomString","length","Math","random","toString","substring","clientId","redirectUri","scope","responseType","state","googleAuthUrl","encodeURIComponent","window","location","href","queryParams","URLSearchParams","search","authorizationCode","exchangeAuthorizationCode","console","error","AuthService","googleLogin","code","isLogIn","then","response","data","isAuthorized","AuthUser","setToken","$router","push","path","AlertService","sendMessage","message","catch","dict","custom","phone","required","password","$validator","localize","validate","valid","login","appId","fbAsyncInit","initializeFacebookSDK","loadFacebookSDK","FB","init","cookie","xfbml","version","attemptLogin","d","s","id","getElementById","js","createElement","src","fjs","getElementsByTagName","parentNode","insertBefore","document","status","authResponse","getUserInfo","accessToken","api","fields","email","authenticateUser","facebookLogin","components","component","post","JSON","stringify","registration","register","verify","ReSendCode","reSendCode","resetPasswordVerify","setPasswordGuest","resetPassword","phoneOrEmail","test"],"mappings":"kHAEA,IAAIA,EAAW,EAAQ,QACnBC,EAAY,EAAQ,QACpBC,EAAa,EAAQ,QAGzB,EAAQ,OAAR,CAAyB,SAAU,GAAG,SAAUC,EAASC,EAAQC,EAASC,GACxE,MAAO,CAGL,SA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AGnBgE,cAzBa,SAyBCC,GACZ,OAAO,OAAY1I,IACjB,OAAQyI,cAAgB,iBAAmBC,IAG/CC,KA9Ba,WA+BX,OAAO,OAAY3I,IAAI,kBAGxBoE,YAlCY,SAkCAK,GACX,OAAO,OAAYsD,KAAK,OAAQ3D,YAAaK,IAMhDmD,cAzCc,SAyCAnD,GACb,OAAO,OAAYsD,KAAK,OAAQH,cAAenD","file":"js/chunk-5ab68647.c33b804f.js","sourcesContent":["'use strict';\n\nvar anObject = require('./_an-object');\nvar sameValue = require('./_same-value');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative($search, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container-fluid\"},[_c('div',{staticClass:\"row py-4 justify-content-center\"},[_c('div',{staticClass:\"col-lg-6 col-10 mb-5\"},[_c('div',{staticClass:\"card\"},[_vm._m(0),_c('div',{staticClass:\"card-body py-4\"},[_c('div',{staticClass:\"row justify-content-center\"},[_c('div',{staticClass:\"col-lg-10 col-12\"},[_c('form',{attrs:{\"autocomplete\":\"off\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.onSubmit($event)}}},[_c('div',{staticClass:\"form-group\"},[_c('label',{staticClass:\"h6 font-weight-bold mb-2\",attrs:{\"for\":\"\"}},[_vm._v(\"Phone/Email\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.phone),expression:\"user.phone\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control phone\",class:_vm.errors.has('phone') ? 'is-invalid' : '',attrs:{\"type\":\"text\",\"name\":\"phone\",\"placeholder\":\"Phone/Email #\"},domProps:{\"value\":(_vm.user.phone)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"phone\", $event.target.value)}}}),(_vm.errors.has('phone'))?_c('span',{staticClass:\"text-danger\"},[_vm._v(\" \"+_vm._s(_vm.errors.first(\"phone\"))+\" \")]):_vm._e()]),_c('div',{staticClass:\"form-group mb-4\"},[_c('label',{staticClass:\"h6 font-weight-bold mb-2\",attrs:{\"for\":\"\"}},[_vm._v(\"Password\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.password),expression:\"user.password\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",class:_vm.errors.has('password') ? 'is-invalid' : '',attrs:{\"type\":\"password\",\"name\":\"password\",\"placeholder\":\"Password\"},domProps:{\"value\":(_vm.user.password)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"password\", $event.target.value)}}}),(_vm.errors.has('password'))?_c('span',{staticClass:\"text-danger\"},[_vm._v(\" \"+_vm._s(_vm.errors.first(\"password\"))+\" \")]):_vm._e()]),_c('div',{staticClass:\"d-flex align-items-center\"},[_c('div',[_c('input',{staticClass:\"btn btn-secondary\",attrs:{\"type\":\"submit\",\"disabled\":_vm.errors.any() || _vm.submitted,\"value\":\"Login Now\"}})]),_c('div',{staticClass:\"ml-auto\"},[_c('router-link',{staticClass:\"ml-2\",attrs:{\"to\":\"/forgot-password\"}},[_vm._v(\"Forgot Password?\")]),_vm._v(\"| \"),_c('router-link',{staticClass:\"ml-2\",attrs:{\"to\":\"/registration\"}},[_vm._v(\"Not Registered?\")])],1)]),_vm._m(1),_c('div',{staticClass:\"d-flex justify-content-center mb-3\"},[_c('button',{staticClass:\"btn btn-google mx-2\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.loginWithGoogle}},[_c('i',{staticClass:\"fab fa-google\"}),_vm._v(\" Continue with Google \")]),_c('button',{staticClass:\"btn btn-facebook mx-2\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.loginWithFacebook}},[_c('i',{staticClass:\"fab fa-facebook-f\"}),_vm._v(\" Continue with Facebook \")]),_c('div',{staticStyle:{\"display\":\"none\"},attrs:{\"id\":\"g_id_onload\"}})])])])])])])])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"card-header\"},[_c('h4',{staticClass:\"text-uppercase playBold text-center\"},[_vm._v(\"Login\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"text-center my-4\"},[_c('span',{staticClass:\"divider-text font-weight-bold\"},[_vm._v(\"OR\")])])}]\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\";\r\nimport { LoginViewModel } from \"../../models/LoginViewModel\";\r\nimport AuthService from \"../../services/AuthService\";\r\nimport AuthUser from \"../../../global-config/AuthUser\";\r\nimport AlertService from \"../../../common-app/service/AlertService\";\r\n@Component({\r\n components: {},\r\n})\r\n\r\nexport default class Login extends Vue {\r\n public submitted: boolean = false;\r\n public user: LoginViewModel = {} as LoginViewModel;\r\n \r\n public loginWithGoogle(){\r\n const generateRandomString = (length: number) => {\r\n return Math.random().toString(36).substring(2, length + 2);\r\n };\r\n \r\n //const clientId = '818198579489-3k300anefbk8sp8v0kvhougd1v7idpg4.apps.googleusercontent.com'; \r\n const clientId='329868347963-vqohivsqlsa8vl3ieen8tjl2el8fb5uo.apps.googleusercontent.com';\r\n const redirectUri = 'https://bddot.com/login'; // Ensure this matches the console\r\n const scope = 'openid profile email';\r\n const responseType = 'code';\r\n const accessType = 'offline'; // To request a refresh token\r\n const state = generateRandomString(16); // Optional, but good for CSRF protection\r\n // Construct the Google authorization URL \r\n const googleAuthUrl = `https://accounts.google.com/o/oauth2/v2/auth?response_type=${responseType}&client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scope)}&state=${state}`;\r\n // Redirect to the Google authorization URL\r\n window.location.href = googleAuthUrl;\r\n }\r\n mounted() {\r\n // Extract query parameters from the URL after redirection from Google\r\n const queryParams = new URLSearchParams(window.location.search);\r\n const authorizationCode = queryParams.get('code');\r\n //const state = queryParams.get('state'); // Retrieve the state parameter if needed\r\n \r\n if (authorizationCode) {\r\n // Exchange the authorization code for a token\r\n this.exchangeAuthorizationCode(authorizationCode);\r\n } else {\r\n console.error('Authorization code not found in URL');\r\n }\r\n}\r\n\r\n\r\nexchangeAuthorizationCode(authorizationCode: string) {\r\n //console.log(\"Authorization Code:\", authorizationCode);\r\n // Call the backend API to exchange the authorization code for a token\r\n AuthService.googleLogin({ code: authorizationCode, isLogIn: true })\r\n .then(response => {\r\n this.submitted = true;\r\n \r\n if (response && response.data && response.data.isAuthorized) {\r\n //console.log(\"Login successful!\", response.data);\r\n // Set the authentication token for the user\r\n \r\n AuthUser.setToken(response.data);\r\n // Redirect to the user home page after successful login\r\n this.$router.push({ path: \"user\" }); // Change to \"home\" if that's the desired route\r\n } else {\r\n //console.warn('Authorization failed. Please check the response.', response.data);\r\n AlertService.sendMessage(response.data.message || 'Authorization failed. Please try again.');\r\n }\r\n })\r\n .catch(error => {\r\n // console.error(\"Login failed\", error);\r\n AlertService.sendMessage(\"Login failed. Please try again.\");\r\n });\r\n}\r\n\r\n\r\n\r\n\r\n created(){\r\n const dict = {\r\n custom: {\r\n phone: {\r\n required: \"The phone or email is required\"\r\n },\r\n password: {\r\n required: \"The password is required\"\r\n }\r\n }\r\n };\r\n this.$validator.localize(\"en\", dict);\r\n }\r\n onSubmit() {\r\n \r\n this.$validator.validate().then((valid) => {\r\n if (valid) {\r\n this.submitted = true;\r\n AuthService.login(this.user)\r\n .then((response) => {\r\n if (response.data.isAuthorized) {\r\n AuthUser.setToken(response.data);\r\n this.$router.push({ path: \"user\" });\r\n } else {\r\n this.submitted = false;\r\n AlertService.sendMessage(response.data);\r\n }\r\n })\r\n .catch(() => {\r\n this.submitted = false;\r\n });\r\n }\r\n });\r\n \r\n }\r\n \r\n\r\n\r\n public loginWithFacebook() {\r\n //console.log('Facebook login triggered');\r\n const appId = '521579997304433'; // Your Facebook App ID\r\n //const appId = '3299349813528395'; \r\n // Initialize the Facebook SDK\r\n window.fbAsyncInit = () => {\r\n this.initializeFacebookSDK(appId);\r\n };\r\n\r\n // Load the Facebook SDK asynchronously\r\n this.loadFacebookSDK();\r\n}\r\n\r\nprivate initializeFacebookSDK(appId: string) {\r\n window.FB.init({\r\n appId: appId,\r\n cookie: true,\r\n xfbml: true,\r\n version: 'v12.0', // The Graph API version\r\n });\r\n\r\n // Attempt to log the user in\r\n this.attemptLogin();\r\n}\r\n\r\nprivate loadFacebookSDK() {\r\n (function (d: Document, s: string, id: string) {\r\n if (d.getElementById(id)) return; // Prevent loading the SDK multiple times\r\n\r\n const js = d.createElement(s) as HTMLScriptElement;\r\n js.id = id;\r\n js.src = \"https://connect.facebook.net/en_US/sdk.js\"; // SDK source\r\n\r\n const fjs = d.getElementsByTagName(s)[0];\r\n if (fjs && fjs.parentNode) { // Check if parentNode is not null\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }\r\n }(document, 'script', 'facebook-jssdk'));\r\n}\r\n\r\nprivate attemptLogin() {\r\n window.FB.login((response: { status: string; authResponse?: { accessToken: string; }; }) => {\r\n //console.log(\"response :\"+response);\r\n // console.log(\"response AuthResponse :\"+response.authResponse);\r\n //console.log(\"response status :\"+response.status);\r\n if (response.status === 'connected' && response.authResponse) {\r\n // User is logged in, fetch their info\r\n this.getUserInfo(response.authResponse.accessToken);\r\n } else {\r\n //console.error('User cancelled login or did not fully authorize.');\r\n AlertService.sendMessage('Login cancelled or failed. Please try again.');\r\n }\r\n }, { scope: 'email' }); // Request permission to access email\r\n}\r\n\r\nprivate getUserInfo(accessToken: string) {\r\n window.FB.api('/me', { fields: 'name,email' }, (user: { name: string; email: string; }) => {\r\n if (user && user.email) {\r\n //console.log('User Info:', user); // Log the user info\r\n this.submitted=true;\r\n // Attempt to log the user in on your backend\r\n this.authenticateUser(accessToken, user);\r\n } else {\r\n //console.error('Failed to fetch user information.');\r\n AlertService.sendMessage('Failed to fetch user information. Please try again.');\r\n }\r\n });\r\n}\r\n\r\nprivate authenticateUser(accessToken: string, user: { name: string; email: string }) {\r\n AuthService.facebookLogin({\r\n accessToken,\r\n name: user.name,\r\n email: user.email\r\n })\r\n .then((response: { data: { isAuthorized: boolean; }; }) => {\r\n if (response.data.isAuthorized) {\r\n // Store the token and navigate to the user page\r\n \r\n AuthUser.setToken(response.data);\r\n this.$router.push({ path: \"user\" });\r\n } else {\r\n // Handle the case where authorization failed\r\n AlertService.sendMessage('Authorization failed. Please try again.');\r\n }\r\n })\r\n .catch((error: any) => {\r\n //console.error('Facebook login error:', error); // Log any errors\r\n AlertService.sendMessage('An error occurred during login. Please try again.');\r\n });\r\n}\r\n\r\n\r\n\r\n}\r\n\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=745162f8&\"\nimport script from \"./Login.vue?vue&type=script&lang=ts&\"\nexport * from \"./Login.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import { UnAuthAxios } from \"../../global-config/HttpConfig\";\r\nimport { LoginViewModel } from \"../models/LoginViewModel\";\r\nimport { RegViewModel } from \"../models/RegViewModel\";\r\nimport { ApiURIs } from \"../../global-config/ApiList\";\r\n// Define a type for the Google login response\r\ninterface GoogleLoginResponse {\r\n isAuthorized: boolean;\r\n token?: string; // Optional token if applicable\r\n message?: string; // Optional message for error handling\r\n}\r\nexport default {\r\n login(user: LoginViewModel) {\r\n return UnAuthAxios.post(ApiURIs.login, JSON.stringify(user));\r\n },\r\n registration(user: RegViewModel) {\r\n return UnAuthAxios.post(ApiURIs.register, JSON.stringify(user));\r\n },\r\n verify(data: any) {\r\n return UnAuthAxios.post(ApiURIs.verify, JSON.stringify(data));\r\n },\r\n ReSendCode(data: any) {\r\n return UnAuthAxios.post(ApiURIs.reSendCode, JSON.stringify(data));\r\n },\r\n resetPasswordVerify(password: string, data: any) {\r\n return UnAuthAxios.post(\r\n `${ApiURIs.resetPasswordVerify}?password=${password}`,\r\n JSON.stringify(data)\r\n );\r\n },\r\n setPasswordGuest(password: string, data: any) {\r\n return UnAuthAxios.post(\r\n `${ApiURIs.setPasswordGuest}?password=${password}`,\r\n JSON.stringify(data)\r\n );\r\n },\r\n resetPassword(phoneOrEmail: string) {\r\n return UnAuthAxios.get(\r\n ApiURIs.resetPassword + \"?phoneOrEmail=\" + phoneOrEmail\r\n );\r\n },\r\n test() {\r\n return UnAuthAxios.get(\"api/user/test\");\r\n },\r\n // Google login method\r\n googleLogin(data: { code: string,isLogIn:boolean }) {\r\n return UnAuthAxios.post(ApiURIs.googleLogin, data); \r\n},\r\n\r\n\r\n // Facebook login method\r\n\r\n facebookLogin(data: { accessToken: string; name: string; email: string }) {\r\n return UnAuthAxios.post(ApiURIs.facebookLogin, data);\r\n}\r\n\r\n\r\n};\r\n\r\n\r\n"],"sourceRoot":""}