Commit 5d41043e authored by Prasanna's avatar Prasanna

qr api calls

parent 3ec4180e
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
# Node.js dependencies:
node_modules/
\ No newline at end of file
service: ms-authenticator
runtime: nodejs14
instance_class: F2
handlers:
- url: /
static_files: dist/scan_qr/index.html
upload: dist/scan_qr/index.html
- url: /
static_dir: dist/scan_qr
inbound_services:
- warmup
automatic_scaling:
target_cpu_utilization: 0.7
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<title>ScanQr</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style type="text/css">@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCRc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fABc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCBc4AMP6lbBP.woff2) format('woff2');unicode-range:U+1F00-1FFF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBxc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0370-03FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fCxc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:300;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2) format('woff2');unicode-range:U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2) format('woff2');unicode-range:U+1F00-1FFF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2) format('woff2');unicode-range:U+0370-03FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2) format('woff2');unicode-range:U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCRc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fABc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCBc4AMP6lbBP.woff2) format('woff2');unicode-range:U+1F00-1FFF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBxc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0370-03FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fCxc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2) format('woff2');unicode-range:U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;}@font-face{font-family:'Roboto';font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}</style>
<style type="text/css">@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/materialicons/v140/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');}.material-icons{font-family:'Material Icons';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:'liga';-webkit-font-smoothing:antialiased;}</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<link rel="stylesheet" href="styles.321051370a5fcdae.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.321051370a5fcdae.css"></noscript></head>
<body>
<app-root></app-root>
<script src="runtime.7379a8014dc3eb0f.js" type="module"></script><script src="polyfills.5dc0be3b31d08df6.js" type="module"></script><script src="main.818a37ad5efb79b2.js" type="module"></script>
</body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
(()=>{"use strict";var e,_={},p={};function n(e){var a=p[e];if(void 0!==a)return a.exports;var r=p[e]={exports:{}};return _[e].call(r.exports,r,r.exports,n),r.exports}n.m=_,e=[],n.O=(a,r,c,l)=>{if(!r){var u=1/0;for(f=0;f<e.length;f++){for(var[r,c,l]=e[f],o=!0,t=0;t<r.length;t++)(!1&l||u>=l)&&Object.keys(n.O).every(h=>n.O[h](r[t]))?r.splice(t--,1):(o=!1,l<u&&(u=l));if(o){e.splice(f--,1);var s=c();void 0!==s&&(a=s)}}return a}l=l||0;for(var f=e.length;f>0&&e[f-1][2]>l;f--)e[f]=e[f-1];e[f]=[r,c,l]},n.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return n.d(a,{a}),a},n.d=(e,a)=>{for(var r in a)n.o(a,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},n.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),(()=>{var e={666:0};n.O.j=c=>0===e[c];var a=(c,l)=>{var t,s,[f,u,o]=l,v=0;if(f.some(d=>0!==e[d])){for(t in u)n.o(u,t)&&(n.m[t]=u[t]);if(o)var b=o(n)}for(c&&c(l);v<f.length;v++)n.o(e,s=f[v])&&e[s]&&e[s][0](),e[s]=0;return n.O(b)},r=self.webpackChunkscan_qr=self.webpackChunkscan_qr||[];r.forEach(a.bind(null,0)),r.push=a.bind(null,r.push.bind(r))})()})();
\ No newline at end of file
.tekblue{color:#021a32}.tekblue1{color:#4b9dee}.tekgreen{color:#c1d82f}.text-field{height:30px;border:.5px solid #d7eafd;border-radius:5px}.text-field:hover{border:.5px solid #021a32}.pointer{cursor:pointer}
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"@techiediaries/ngx-qrcode": "^9.1.0", "@techiediaries/ngx-qrcode": "^9.1.0",
"bootstrap": "^5.2.3", "bootstrap": "^5.2.3",
"rxjs": "~7.5.0", "rxjs": "~7.5.0",
"sweetalert2": "^11.7.3",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.12.0" "zone.js": "~0.12.0"
}, },
...@@ -10880,6 +10881,15 @@ ...@@ -10880,6 +10881,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/sweetalert2": {
"version": "11.7.3",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.7.3.tgz",
"integrity": "sha512-fUN/fyVSBZNtY4Rr/Qtxn7tNNnlRAbUhQxTQ9uOo0xVMIHBmqq4/9pau5N9dB2pvkB353XL/ywRAycscLoYU3w==",
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/limonte"
}
},
"node_modules/symbol-observable": { "node_modules/symbol-observable": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz",
......
...@@ -6,10 +6,10 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; ...@@ -6,10 +6,10 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
}) })
export class GlobalService { export class GlobalService {
base_url : string = 'https://authenticator-registration-dot-tgs-dws-saigeautoforsd-dev-001.wn.r.appspot.com/'; base_url : string = 'https://authenticator-registration-dot-tgs-ag-mpi-dev-001.uc.r.appspot.com/';
getsecret : string = this.base_url+'generateSecret' getsecret : string = this.base_url+'generateSecret'
sendotp : string = this.base_url+'sendotp'; sendotp : string = this.base_url+'sendOtp';
validate : string = this.base_url+'validateOTP_and_RegisterUser' validate : string = this.base_url+'validateOtpAndRegisterUser'
constructor(public http: HttpClient) { } constructor(public http: HttpClient) { }
getQr(){ getQr(){
return this.http.get(this.getsecret); return this.http.get(this.getsecret);
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
</div> </div>
</div> </div>
<div class="row mb-3">
<div class="col">
<button class="ctn-btn" (click)="appLogin()">Login</button>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-8"> Don't have an account? </div> <div class="col-8"> Don't have an account? </div>
......
...@@ -24,6 +24,13 @@ export class LoginComponent implements OnInit { ...@@ -24,6 +24,13 @@ export class LoginComponent implements OnInit {
localStorage.setItem('email',this.login.email) localStorage.setItem('email',this.login.email)
this.globals.getOtp(this.login.email).subscribe((res : any)=>{ this.globals.getOtp(this.login.email).subscribe((res : any)=>{
console.log(res); console.log(res);
this.login.otp = res.otp
}) })
} }
appLogin(){
if(this.login.otp){
this.router.navigateByUrl('/scanqr')
}
}
} }
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgxQrcodeElementTypes, NgxQrcodeErrorCorrectionLevels } from '@techiediaries/ngx-qrcode'; import { NgxQrcodeElementTypes, NgxQrcodeErrorCorrectionLevels } from '@techiediaries/ngx-qrcode';
import { GlobalService } from '../global.service'; import { GlobalService } from '../global.service';
import Swal from 'sweetalert2';
@Component({ @Component({
selector: 'app-scanqr', selector: 'app-scanqr',
...@@ -29,11 +30,14 @@ export class ScanqrComponent implements OnInit { ...@@ -29,11 +30,14 @@ export class ScanqrComponent implements OnInit {
let postObj = { let postObj = {
totp : this.genOtp, totp : this.genOtp,
email : localStorage.getItem('email'), email : localStorage.getItem('email'),
secret : this.qrDetails.secret secret : this.qrDetails.secret.base32,
phone_number : this.phnNumber
} }
console.log(postObj)
this.globals.validateQr(postObj).subscribe((res : any)=>{ this.globals.validateQr(postObj).subscribe((res : any)=>{
console.log(res); console.log(res);
if(res.insert_to_db == 'True' && res.validated == true){
Swal.fire("success", "App validated Successfully","success")
}
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment