Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
T
t3
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
t3
Commits
ff892708
Commit
ff892708
authored
12 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(chore): pushing new modules for olivia
parent
83ee1729
master
No related merge requests found
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
102 additions
and
20 deletions
+102
-20
app.component.html
app/src/app/app.component.html
+0
-2
app.component.ts
app/src/app/app.component.ts
+1
-17
app.module.ts
app/src/app/app.module.ts
+9
-1
api.service.ts
app/src/app/modules/common/api.service.ts
+0
-0
uport.module.ts
app/src/app/modules/uport/uport.module.ts
+7
-0
verification.service.ts
app/src/app/modules/uport/verification.service.ts
+43
-0
verification.component.html
app/src/app/modules/verification/verification.component.html
+1
-0
verification.component.ts
app/src/app/modules/verification/verification.component.ts
+15
-0
verification.module.ts
app/src/app/modules/verification/verification.module.ts
+22
-0
login.service.js
server/src/login.service.js
+4
-0
No files found.
app/src/app/app.component.html
View file @
ff892708
...
...
@@ -5,6 +5,4 @@
</h1>
</div>
<img
[src]=
"qrImageUri"
/>
<router-outlet></router-outlet>
This diff is collapsed.
Click to expand it.
app/src/app/app.component.ts
View file @
ff892708
import
{
Component
}
from
"
@angular/core
"
;
import
{
HttpClient
}
from
"
@angular/common/http
"
;
import
{
DomSanitizer
,
SafeUrl
}
from
"
@angular/platform-browser
"
;
// import * as Connect from "uport-connect";
declare
const
Connect
:
any
;
...
...
@@ -12,19 +9,6 @@ declare const Connect: any;
})
export
class
AppComponent
{
title
=
"
t3
"
;
qrImageUri
:
SafeUrl
;
constructor
(
private
http
:
HttpClient
,
private
sanitizer
:
DomSanitizer
)
{}
ngOnInit
()
{
// const uport = new Connect("Minds Trust (t3)", );
// uport.requestDisclosure();
this
.
fetchQrImageUri
();
}
async
fetchQrImageUri
()
{
this
.
http
.
get
(
"
http://localhost:8088/qr
"
).
subscribe
((
data
:
any
)
=>
{
this
.
qrImageUri
=
this
.
sanitizer
.
bypassSecurityTrustUrl
(
data
.
qrImageData
);
});
}
constructor
()
{}
}
This diff is collapsed.
Click to expand it.
app/src/app/app.module.ts
View file @
ff892708
...
...
@@ -4,10 +4,18 @@ import { HttpClientModule } from "@angular/common/http";
import
{
AppRoutingModule
}
from
"
./app-routing.module
"
;
import
{
AppComponent
}
from
"
./app.component
"
;
import
{
uPortModule
}
from
"
./modules/uport/uport.module
"
;
import
{
T3VerificationModule
}
from
"
./modules/verification/verification.module
"
;
@
NgModule
({
declarations
:
[
AppComponent
],
imports
:
[
BrowserModule
,
AppRoutingModule
,
HttpClientModule
],
imports
:
[
BrowserModule
,
AppRoutingModule
,
HttpClientModule
,
uPortModule
,
T3VerificationModule
],
providers
:
[],
bootstrap
:
[
AppComponent
]
})
...
...
This diff is collapsed.
Click to expand it.
app/src/app/common/api.service.ts
→
app/src/app/
modules/
common/api.service.ts
View file @
ff892708
File moved
This diff is collapsed.
Click to expand it.
app/src/app/modules/uport/uport.module.ts
0 → 100644
View file @
ff892708
import
{
NgModule
}
from
"
@angular/core
"
;
import
{
uPortVerificationService
}
from
"
./verification.service
"
;
@
NgModule
({
providers
:
[
uPortVerificationService
]
})
export
class
uPortModule
{}
This diff is collapsed.
Click to expand it.
app/src/app/modules/uport/verification.service.ts
0 → 100644
View file @
ff892708
import
{
Injectable
}
from
"
@angular/core
"
;
import
{
HttpClient
}
from
"
@angular/common/http
"
;
import
{
SafeUrl
,
DomSanitizer
}
from
"
@angular/platform-browser
"
;
import
{
Subject
,
interval
,
BehaviorSubject
}
from
"
rxjs
"
;
import
{
first
}
from
"
rxjs/operators
"
;
@
Injectable
()
export
class
uPortVerificationService
{
qrImageUri$
:
Subject
<
SafeUrl
>
=
new
Subject
();
data$
:
BehaviorSubject
<
any
>
=
new
BehaviorSubject
(
null
);
constructor
(
private
http
:
HttpClient
,
private
sanitizer
:
DomSanitizer
)
{
this
.
start
();
}
/**
* Commence login
*/
async
start
():
Promise
<
void
>
{
await
this
.
fetch
();
this
.
startPolling
();
}
async
fetch
():
Promise
<
void
>
{
const
data
=
await
this
.
http
.
get
(
"
http://localhost:8088/qr
"
).
toPromise
();
this
.
data$
.
next
(
data
);
}
/**
* Fetch a qr code
*/
fetchQrImageUri
():
void
{
this
.
data$
.
subscribe
((
data
:
any
)
=>
{
this
.
qrImageUri$
.
next
(
this
.
sanitizer
.
bypassSecurityTrustUrl
(
data
.
qrImageData
)
);
});
}
startPolling
()
{
interval
(
1000
).
subscribe
(
async
()
=>
{});
}
}
This diff is collapsed.
Click to expand it.
app/src/app/modules/verification/verification.component.html
0 → 100644
View file @
ff892708
<img
[src]=
"verificationService.qrImageUri$ | async"
/>
This diff is collapsed.
Click to expand it.
app/src/app/modules/verification/verification.component.ts
0 → 100644
View file @
ff892708
import
{
Component
}
from
"
@angular/core
"
;
import
{
uPortVerificationService
}
from
"
../uport/verification.service
"
;
@
Component
({
selector
:
"
t3-verification
"
,
templateUrl
:
"
./verification.component.html
"
})
export
class
T3VerificationComponent
{
constructor
(
public
verificationService
:
uPortVerificationService
)
{}
ngOnInit
()
{
this
.
verificationService
.
fetchQrImageUri
();
this
.
verificationService
.
startPolling
();
}
}
This diff is collapsed.
Click to expand it.
app/src/app/modules/verification/verification.module.ts
0 → 100644
View file @
ff892708
import
{
NgModule
}
from
"
@angular/core
"
;
import
{
T3VerificationComponent
}
from
"
./verification.component
"
;
import
{
uPortModule
}
from
"
../uport/uport.module
"
;
import
{
Router
,
RouterModule
}
from
"
@angular/router
"
;
import
{
CommonModule
}
from
"
@angular/common
"
;
@
NgModule
({
imports
:
[
CommonModule
,
uPortModule
,
RouterModule
,
RouterModule
.
forChild
([
{
path
:
"
verification
"
,
component
:
T3VerificationComponent
}
])
],
declarations
:
[
T3VerificationComponent
],
entryComponents
:
[
T3VerificationComponent
]
})
export
class
T3VerificationModule
{}
This diff is collapsed.
Click to expand it.
server/src/login.service.js
View file @
ff892708
...
...
@@ -42,6 +42,7 @@ app.get("/qr", async (req, res) => {
);
const
qr
=
transports
.
ui
.
getImageDataURI
(
uri
);
res
.
send
({
uri
,
qrImageData
:
qr
});
}
catch
(
err
)
{}
...
...
@@ -58,3 +59,6 @@ app.post("/callback", async (req, res) => {
console
.
log
(
err
);
}
});
// run the app server and tunneling service
const
server
=
app
.
listen
(
8088
,
()
=>
{});
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment