Skip to content

Instantly share code, notes, and snippets.

@umutyerebakmaz
Created October 11, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umutyerebakmaz/593b1baeedb27cbb286aa3cc52752161 to your computer and use it in GitHub Desktop.
Save umutyerebakmaz/593b1baeedb27cbb286aa3cc52752161 to your computer and use it in GitHub Desktop.
import { Injectable, OnInit } from '@angular/core';
import { AccountsClient } from '@accounts/client';
@Injectable({
providedIn: 'root'
})
export class LoginService implements OnInit {
public userLoginStatus = 'defaultLoginData';
constructor(private accountsClient: AccountsClient) {}
ngOnInit() {
console.log('login service worked!');
}
async getTokens() {
const tokens = await this.accountsClient.getTokens();
if (tokens) {
return this.userLoginStatus = 'true';
}
return this.userLoginStatus = 'false';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment