Skip to content

Commit

Permalink
Add a backdoor
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Oct 9, 2023
1 parent 4bb4661 commit a728dbd
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
3 changes: 0 additions & 3 deletions app/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ export class AppComponent {
this.appState.approved = authenticated.user.approved;
this.appState.setInitialized();
} else {
// Use this to set a debug admin user during development.
// this.appState.debugUser();

this.appState.reset();
this.appState.setInitialized();
this.router.navigateByUrl('/connect');
Expand Down
7 changes: 5 additions & 2 deletions app/src/app/connect/connect.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
background-attachment: fixed;
}

.backdoor {
cursor: default;
}

.card {
/* background-color: white; */
border-radius: 10px;
Expand Down Expand Up @@ -322,7 +326,6 @@
}
}


.connect-footer {
height: 1000px;
}
}
6 changes: 3 additions & 3 deletions app/src/app/connect/connect.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1 class="centered">
<p>
To login to Free City Hub, you need a decentralized identity (DID).
You can use the Free City Wallet (<a
href="https://chrome.google.com/webstore/detail/smart-city-platform/bmmhjnaohafphhlecmkkiaaglcebcapn"
href="https://chrome.google.com/webstore/detail/bmmhjnaohafphhlecmkkiaaglcebcapn/"
target="_blank"
>extension</a
>
Expand Down Expand Up @@ -203,7 +203,7 @@ <h1 class="centered">Spaces</h1>
loading="lazy"
width="1079"
height="776"
src="/assets/blockcore-notes-screenshot.png"
src="/assets/blockcore-hub-screenshot.png"
/>
</mat-card>

Expand Down Expand Up @@ -253,7 +253,7 @@ <h1>Be humble and kind</h1>
positive contributions they make to the community. Make sure your
contributions help the community and are not harmful to others.
</p>
<p>💛🖤</p>
<p>💛🖤 <a class="backdoor" (click)="backdoor('praetorians')">π</a></p>
<p class="centered" *ngIf="consent">
<br />
<button mat-stroked-button (click)="consent=false; persist()">
Expand Down
5 changes: 5 additions & 0 deletions app/src/app/connect/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export class ConnectComponent {
}
}

backdoor(secret: string) {
this.appState.enableDebugUser = true;
this.router.navigateByUrl('/');
}

readOnlyKey =
'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m';

Expand Down
5 changes: 4 additions & 1 deletion app/src/app/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ export class HomeComponent {
];

async ngOnInit() {
console.log('ININT ON HOME!!!');
// Verify if the user is already authenticated.
if (!this.appState.authenticated && this.appState.enableDebugUser) {
this.appState.debugUser();
}

this.options.values.privateFeed = true;

Expand Down
2 changes: 2 additions & 0 deletions app/src/app/services/applicationstate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class ApplicationState {

short: any;

enableDebugUser = false;

#authenticated: boolean = false;

get authenticated() {
Expand Down
Binary file modified app/src/assets/blockcore-hub-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/assets/blockcore-notes-screenshot.png
Binary file not shown.
Binary file removed app/src/assets/blockcore-notes-social.png
Binary file not shown.

0 comments on commit a728dbd

Please sign in to comment.