Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 420] Invert boolean logic to fix the links. #421

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

kaladay
Copy link

@kaladay kaladay commented Jan 23, 2025

Description

Resolves #420 .

While logged out, the boolean observable is somehow an empty string.

Using the following in the HTML shows the value:

<div>DEBUG: isauth = {{isAuthenticated | async}}</div>

An alternative way to review the value of isAuthenticated is to do modify the ts file using the following snippets:

  import { Observable, tap } from 'rxjs';

  public debug: any;

  this.isAuthenticated.pipe(
    tap(x => this.debug = x)
  ).subscribe(x => console.log(x));

  console.log("DEBUG: ngoninit this.isAuthenticated=", this.debug, typeof this.debug);

  console.log("DEBUG: on login this.isAuthenticated=", this.debug, typeof this.debug);

  console.log("DEBUG: on logout this.isAuthenticated=", this.debug, typeof this.debug);

This produced messages on login popup like this:

DEBUG: on login this.isAuthenticated= <empty string> string

This produced message on logout like this:

DEBUG: on logout this.isAuthenticated= true boolean

There might be a bigger issue to resolve here in regards to preventing an empty string.
The goal of this change is just to ensure the admin register and admin login links still work.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing Procedures

Manually logged in and out.
Used the example snippets to observe the variable values.

While logged out, the boolean observable is somehow an empty string.

Using the following in the HTML shows the value:
```html
<div>DEBUG: isauth = {{isAuthenticated | async}}</div>
```

An alternative way to review the value of `isAuthenticated` is to do modify the ts file using the following snippets:

```ts
  import { Observable, tap } from 'rxjs';

  public debug: any;

  this.isAuthenticated.pipe(
    tap(x => this.debug = x)
  ).subscribe(x => console.log(x));

  console.log("DEBUG: ngoninit this.isAuthenticated=", this.debug, typeof this.debug);

  console.log("DEBUG: on login this.isAuthenticated=", this.debug, typeof this.debug);

  console.log("DEBUG: on logout this.isAuthenticated=", this.debug, typeof this.debug);
```

This produced messages on login popup like this:
```
DEBUG: on login this.isAuthenticated= <empty string> string
```

This produced message on logout like this:
```
DEBUG: on logout this.isAuthenticated= true boolean
```

There might be a bigger issue to resolve here in regards to preventing an empty string.
The goal of this change is just to ensure the admin register and admin login links still work.
@kaladay kaladay changed the base branch from main to sprint-9-staging January 23, 2025 21:28
@kaladay kaladay requested a review from Dbreck-TAMU January 23, 2025 21:28
@kaladay kaladay linked an issue Jan 23, 2025 that may be closed by this pull request
4 tasks
@wwtamu
Copy link

wwtamu commented Jan 24, 2025

The investigation into this was not comprehensive and poorly reported. This change is insignificant and is not fixing anything or discovering any bug.

Please reevaluate as the likely issue may be developer browser cookie settings and incomplete logic here not accounting for all scenarios of browser settings.

https://github.com/TAMULib/scholars-angular/blob/tamu-main/src/app/core/service/rest.service.ts#L23

image

image

@Dbreck-TAMU Dbreck-TAMU merged commit 0fa4a77 into sprint-9-staging Jan 24, 2025
@kaladay kaladay deleted the 420-admin_links_missing branch January 31, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin Register and Admin Login links do not show up.
3 participants