diff --git a/src/app/modules/auth/sign-in/sign-in.component.html b/src/app/modules/auth/sign-in/sign-in.component.html
index 8173e3a..c5feeb3 100644
--- a/src/app/modules/auth/sign-in/sign-in.component.html
+++ b/src/app/modules/auth/sign-in/sign-in.component.html
@@ -81,9 +81,11 @@
비밀번호를 입력하세요
+
보안코드*
+
보안코드를 입력하세요.
diff --git a/src/app/modules/auth/sign-in/sign-in.component.ts b/src/app/modules/auth/sign-in/sign-in.component.ts
index ce4f89a..ecc4ed9 100644
--- a/src/app/modules/auth/sign-in/sign-in.component.ts
+++ b/src/app/modules/auth/sign-in/sign-in.component.ts
@@ -1,9 +1,11 @@
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, NgForm, Validators } from '@angular/forms';
+import { DomSanitizer } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import { fuseAnimations } from '@fuse/animations';
import { FuseAlertType } from '@fuse/components/alert';
import { AuthService } from 'app/core/auth/auth.service';
+import { IdentityService } from 'app/modules/polyglot/member/services/identity.service';
@Component({
selector: 'auth-sign-in',
@@ -20,6 +22,8 @@ export class AuthSignInComponent implements OnInit {
};
signInForm!: FormGroup;
showAlert: boolean = false;
+ captchaToken?: string;
+ imagePath?: any;
/**
* Constructor
@@ -28,7 +32,9 @@ export class AuthSignInComponent implements OnInit {
private _activatedRoute: ActivatedRoute,
private _authService: AuthService,
private _formBuilder: FormBuilder,
- private _router: Router
+ private _router: Router,
+ private _identityService: IdentityService,
+ private _sanitizer: DomSanitizer
) {}
// -----------------------------------------------------------------------------------------------------
@@ -48,12 +54,20 @@ export class AuthSignInComponent implements OnInit {
password: ['admin', Validators.required],
// recaptcha: ['', Validators.required],
});
+ this._identityService.captcha().then((result) => {
+ console.log('success', result, result.getToken(), result.getImage());
+
+ this.imagePath = this._sanitizer.bypassSecurityTrustResourceUrl(
+ 'data:image/jpg;base64,' + result.getImage()
+ );
+ });
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
+ __getImagePath(): void {}
/**
* Sign in
*/
diff --git a/src/app/modules/polyglot/member/services/identity.service.ts b/src/app/modules/polyglot/member/services/identity.service.ts
index 086efa3..dae1c60 100644
--- a/src/app/modules/polyglot/member/services/identity.service.ts
+++ b/src/app/modules/polyglot/member/services/identity.service.ts
@@ -52,8 +52,8 @@ export class IdentityService {
});
}
- captcha(): Promise {
- return new Promise((resolve, reject) => {
+ captcha(): Promise {
+ return new Promise((resolve, reject) => {
let req = new CaptchaRequest();
this.__natsService
@@ -63,7 +63,7 @@ export class IdentityService {
CaptchaResponse.deserializeBinary
)
.then((result) => {
- console.log('success', result, result.getToken(), result.getImage());
+ resolve(result);
})
.catch((e: Error) => {
console.log('failed', e.getCode(), e.getMessage(), e.getData());