From 38ae8e9feb763d2c844e8517e459655dec053016 Mon Sep 17 00:00:00 2001 From: Khaja Takreem UlLa <78692ishaq@gmail.com> Date: Sat, 30 Jul 2022 14:17:27 +0530 Subject: [PATCH] Backend Integration --- frontend/src/app/app-routing.module.ts | 4 ++ .../generate-token.component.html | 47 +++++++------- .../generate-token.component.scss | 7 +- .../generate-token.component.ts | 20 +++++- .../generate-token/generate-token.module.ts | 2 + .../generate-token1.component.html | 2 +- .../generate-token1.component.ts | 5 ++ .../src/app/login/login-routing.module.ts | 16 +++++ frontend/src/app/login/login.component.html | 9 +++ frontend/src/app/login/login.component.scss | 20 ++++++ .../src/app/login/login.component.spec.ts | 25 +++++++ frontend/src/app/login/login.component.ts | 29 +++++++++ frontend/src/app/login/login.module.ts | 19 ++++++ .../app/send-jwt1/send-jwt1.component.html | 9 +-- .../app/send-jwt1/send-jwt1.component.scss | 5 +- .../src/app/send-jwt1/send-jwt1.component.ts | 14 +++- .../app/send-jwt2/send-jwt2.component.html | 9 ++- .../app/send-jwt2/send-jwt2.component.scss | 4 +- .../src/app/send-jwt2/send-jwt2.component.ts | 17 +++++ .../src/app/send-jwt2/send-jwt2.module.ts | 3 +- .../app/send-jwt3/send-jwt3.component.html | 17 ++++- .../app/send-jwt3/send-jwt3.component.scss | 2 +- .../src/app/send-jwt3/send-jwt3.component.ts | 13 ++++ .../app/send-jwt4/send-jwt4.component.html | 16 ++--- .../app/send-jwt4/send-jwt4.component.scss | 6 +- .../src/app/send-jwt4/send-jwt4.component.ts | 25 +++++++ .../src/app/shared/services/demo.service.ts | 65 +++++++++++++++++++ .../src/app/shared/services/jwt.service.ts | 4 ++ frontend/src/assets/i18n/en.json | 7 +- 29 files changed, 368 insertions(+), 53 deletions(-) create mode 100644 frontend/src/app/login/login-routing.module.ts create mode 100644 frontend/src/app/login/login.component.html create mode 100644 frontend/src/app/login/login.component.scss create mode 100644 frontend/src/app/login/login.component.spec.ts create mode 100644 frontend/src/app/login/login.component.ts create mode 100644 frontend/src/app/login/login.module.ts create mode 100644 frontend/src/app/shared/services/demo.service.ts diff --git a/frontend/src/app/app-routing.module.ts b/frontend/src/app/app-routing.module.ts index 2c5a5f1..e493099 100644 --- a/frontend/src/app/app-routing.module.ts +++ b/frontend/src/app/app-routing.module.ts @@ -67,6 +67,10 @@ const routes: Routes = [ path: 'reference', loadChildren: () => import('./reference/reference.module').then(mod => mod.ReferenceModule), }, + { + path: 'authorize', + loadChildren: () => import('./login/login.module').then(mod => mod.LoginModule), + }, { path: '**', redirectTo: 'home', diff --git a/frontend/src/app/generate-token/generate-token.component.html b/frontend/src/app/generate-token/generate-token.component.html index 9d232a9..f972156 100644 --- a/frontend/src/app/generate-token/generate-token.component.html +++ b/frontend/src/app/generate-token/generate-token.component.html @@ -7,31 +7,32 @@
- HS256 - -
+ \ No newline at end of file diff --git a/frontend/src/app/login/login.component.scss b/frontend/src/app/login/login.component.scss new file mode 100644 index 0000000..930bf68 --- /dev/null +++ b/frontend/src/app/login/login.component.scss @@ -0,0 +1,20 @@ +.login_input{ + background-color: #161f27; + color: #fff; + border: none; + padding: 8px; + border-radius: 4px; + margin-bottom: 10px ; + width: 250px; +} +.form_group{ + display: flex; + flex-direction: column; +} +.login_button{ + background-color: #161f27; + padding: 10px 20px; + border: none; + color: #fff; + border-radius: 4px; +} \ No newline at end of file diff --git a/frontend/src/app/login/login.component.spec.ts b/frontend/src/app/login/login.component.spec.ts new file mode 100644 index 0000000..d2c0e6c --- /dev/null +++ b/frontend/src/app/login/login.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture{{ "send-jwt1.request2" | transloco}}
-
+ {{ "send-jwt1.code" | transloco }}
+ Sample Response + HTTP/1.1 200 OK + Content-Type: application/json;charset=UTF-8 + Cache-Control: no-store + Pragma: no-cache + + {{'send-jwt3.openBracket' | transloco}} + "access_token":"mF_9.B5f-4.1JqM", + "token_type":"Bearer", + "expires_in":3600, + "refresh_token":"tGzv3JOkF0XG5Qx2TlKWIA" + {{ 'send-jwt3.closeBracket' | transloco}} +
1.
- {{"send-jwt4.step1" | transloco}}
+
-
2.
- {{"send-jwt4.step2" | transloco}}
+
-
3.
- {{"send-jwt4.step3" | transloco}}
+
-
4.
- {{"send-jwt4.step4" | transloco}}
+
-