Skip to content

Commit

Permalink
Merge pull request #144 from GSA/feature/dev_login
Browse files Browse the repository at this point in the history
Adding a Login option easily for developer on local box
  • Loading branch information
BuckinghamAJ authored Oct 10, 2024
2 parents 2146def + 3b0ed33 commit fb81279
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/auth/userlogin/userlogin.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
</div>

<div class="text-center">
<button *ngIf="is_dev" class="srt-button m-2"
style="float:none; display:inline; margin-top:3em;"
id="login"
aria-label="Login as Dev"
onClick=" (function() {
var client_host = window.location.hostname
var server_host = '';
if (client_host === 'localhost') { server_host = 'localhost:3000'}
//default to current name for dev servers
if (server_host === '') { server_host = 'localhost:3000';}
window.location = 'http://' + server_host + '/api/casLogin'
}()) ">Login as DEV
</button>
<button class="srt-button m-2"
style="float:none; display:inline; margin-top:3em; "
id="login"
Expand Down
3 changes: 3 additions & 0 deletions src/app/auth/userlogin/userlogin.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {environment} from '../../../environments/environment';
import {BaseComponent} from '../../base.component';
import {Title} from '@angular/platform-browser';


@Component({
selector: 'app-userlogin',
templateUrl: './userlogin.component.html',
Expand All @@ -25,6 +26,8 @@ export class UserloginComponent extends BaseComponent implements OnInit {
errorInformation = '';
public loginUrl = environment.SERVER_URL + '/casLogin';

public is_dev = environment.ENVIRONMENT === 'local';

/* CONSTRUCTOR */

/**
Expand Down

0 comments on commit fb81279

Please sign in to comment.