From 5acc79d212172a87f8f66d5af5936773f71048cb Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Tue, 10 May 2022 16:00:35 -0400 Subject: [PATCH] Clean up app login page. Remove unused global var. --- example/frontend/src/app/identity.service.ts | 5 -- src/app/app.component.ts | 5 -- src/app/global-vars.service.ts | 3 +- src/app/log-in-app/log-in-app.component.html | 60 ++++++-------------- src/app/log-in-app/log-in-app.component.ts | 6 ++ src/app/sign-up/sign-up.component.ts | 8 ++- 6 files changed, 29 insertions(+), 58 deletions(-) diff --git a/example/frontend/src/app/identity.service.ts b/example/frontend/src/app/identity.service.ts index e55162a..e96db3e 100644 --- a/example/frontend/src/app/identity.service.ts +++ b/example/frontend/src/app/identity.service.ts @@ -50,7 +50,6 @@ export class IdentityService { nonWitnessUtxoHexes?: string, fromAddress?: string, public_key?: string; - accessLevelRequest?: number; } ): Observable { let url = this.identityServiceURL as string; @@ -92,10 +91,6 @@ export class IdentityService { httpParams = httpParams.append("public_key", params.public_key); } - if (params?.accessLevelRequest) { - httpParams = httpParams.append("accessLevelRequest", params.accessLevelRequest.toString()); - } - const paramsStr = httpParams.toString(); if (paramsStr) { url += `?${paramsStr}`; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d4e2356..b5ab848 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -22,11 +22,6 @@ export class AppComponent implements OnInit { // load params const params = new URLSearchParams(window.location.search); - const accessLevelRequest = params.get('accessLevelRequest'); - if (accessLevelRequest) { - this.globalVars.accessLevelRequest = parseInt(accessLevelRequest, 10); - } - if (params.get('webview')) { this.globalVars.webview = true; } diff --git a/src/app/global-vars.service.ts b/src/app/global-vars.service.ts index 90cf057..adbe496 100644 --- a/src/app/global-vars.service.ts +++ b/src/app/global-vars.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import {AccessLevel, Network} from '../types/identity'; +import {Network} from '../types/identity'; import {environment} from '../environments/environment'; @Injectable({ @@ -8,7 +8,6 @@ import {environment} from '../environments/environment'; export class GlobalVarsService { network : Network = Network.MainNet; hostname = ''; - accessLevelRequest = AccessLevel.ApproveAll; inTab = !!window.opener; webview = false; diff --git a/src/app/log-in-app/log-in-app.component.html b/src/app/log-in-app/log-in-app.component.html index b336f94..dd32fd4 100644 --- a/src/app/log-in-app/log-in-app.component.html +++ b/src/app/log-in-app/log-in-app.component.html @@ -1,18 +1,10 @@ - -
- Choose an account to share with {{ globalVars.hostname }} + Choose a channel to share with {{ globalVars.hostname }}
- -
    Select an account @@ -20,7 +12,10 @@ TODO - Unused for now. Revamp this page to be a channel picker for logging in
  • -
    {{ item.value.handle }}
    + {{ item.value.handle }} +   +   + (#{{ item.value.claimId }})
  • @@ -28,50 +23,27 @@ TODO - Unused for now. Revamp this page to be a channel picker for logging in
+ +
- - Wallet Sync Log In
- Logging in grants {{ globalVars.hostname }} access to: + Logging in grants {{ globalVars.hostname }} access to your public + channel information. As you use the site, you will perform actions (such + as leaving a comment or spending LBC) that will bring you back here to + get your permission. At that point, you will have the option to give the + app permission to perform the same sort of action again without bringing + up another popup.
- - -
    -
  • - - - My basic information -
    {{ globalVars.hostname }} can access my public key and any other public information
    -
  • -
  • - - - Post, message, like, and follow on my behalf -
    {{ globalVars.hostname }} will require approval to post, message, like, and follow
    -
    {{ globalVars.hostname }} may post, message, like, and follow without requiring approval
    -
  • -
  • - - - Buy, sell, and send coins on my behalf -
    {{ globalVars.hostname }} will require approval to buy, sell, or send coins
    -
    {{ globalVars.hostname }} may buy, sell, and send coins without requiring approval
    -
  • -
diff --git a/src/app/log-in-app/log-in-app.component.ts b/src/app/log-in-app/log-in-app.component.ts index de01c2d..a5bbcab 100644 --- a/src/app/log-in-app/log-in-app.component.ts +++ b/src/app/log-in-app/log-in-app.component.ts @@ -26,6 +26,12 @@ export class LogInAppComponent implements OnInit { selectAccount(channelClaimId: string): void { this.accountService.setAccessCurrentChannel(this.globalVars.hostname, channelClaimId) + // At this point, DeSo had globalVars.accessLevelRequest, where the app + // would specify which access level it would be operating with, and the + // user would grant permission on login. We could do something similar: The + // app could specify which sorts of actions it will be likely asking + // permission for. The user could specify on login "don't bother asking my + // permission for these actions" so they never get a popup for it. this.identityService.login({ channel: this.accountService.getActiveChannel(this.globalVars.hostname), diff --git a/src/app/sign-up/sign-up.component.ts b/src/app/sign-up/sign-up.component.ts index 361f58d..cf87c19 100644 --- a/src/app/sign-up/sign-up.component.ts +++ b/src/app/sign-up/sign-up.component.ts @@ -83,6 +83,11 @@ export class SignUpComponent implements OnInit, OnDestroy { throw 'signup not implemented' /* + + // this is a mix of some of what DeSo left over, and some new LBRY.id + // specific things that I figure we won't want to forget. This is just + // a guide for the future when we tackle signup. + const network = this.globalVars.network; const mnemonic = this.mnemonicCheck; const extraText = this.extraTextCheck; @@ -90,8 +95,7 @@ export class SignUpComponent implements OnInit, OnDestroy { const accountNameAdded = this.accountService.addUser(keychain, mnemonic, extraText, network); - this.accountService.setAccessLevel( - accountNameAdded, this.globalVars.hostname, this.globalVars.accessLevelRequest); + this.accountService.initAccess() this.login(); */