-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move auth service calls into constructor to simplify and centralize i…
…ntegration steps for auth functionality
- Loading branch information
Showing
4 changed files
with
24 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { AuthService } from './auth/auth.service'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent implements OnInit { | ||
|
||
constructor(private auth: AuthService) {} | ||
|
||
ngOnInit() { | ||
// On initial load, check authentication state with authorization server | ||
// Set up local auth streams if user is already authenticated | ||
this.auth.localAuthSetup(); | ||
// Handle redirect from Auth0 login | ||
this.auth.handleAuthCallback(); | ||
} | ||
|
||
export class AppComponent { | ||
constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { AuthService } from './auth/auth.service'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent implements OnInit { | ||
|
||
constructor(private auth: AuthService) {} | ||
|
||
ngOnInit() { | ||
// On initial load, check authentication state with authorization server | ||
// Set up local auth streams if user is already authenticated | ||
this.auth.localAuthSetup(); | ||
// Handle redirect from Auth0 login | ||
this.auth.handleAuthCallback(); | ||
} | ||
|
||
export class AppComponent { | ||
constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters