Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
#70 Add getCurrentUser Method
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Jul 12, 2016
1 parent f0d2513 commit aeaf670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions firebase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ declare module "nativescript-plugin-firebase" {
/**
* The returned object from the login function.
*/
export interface LoginResult {
export interface User {
uid: string;
email?: string;
provider: LoginType;
Expand Down Expand Up @@ -151,7 +151,7 @@ declare module "nativescript-plugin-firebase" {

export interface AuthStateData {
loggedIn?: boolean;
user?: LoginResult;
user?: User;
}

export interface AuthStateChangeListener {
Expand Down Expand Up @@ -318,7 +318,7 @@ declare module "nativescript-plugin-firebase" {
export function addValueEventListener(onValueEvent: (data: FBData) => void, path: string): Promise<any>;

// Auth
export function login(options: LoginOptions): Promise<LoginResult>;
export function login(options: LoginOptions): Promise<User>;
export function logout(): Promise<any>;
export function createUser(options: CreateUserOptions): Promise<CreateUserResult>;
export function deleteUser(): Promise<any>;
Expand All @@ -327,6 +327,7 @@ declare module "nativescript-plugin-firebase" {
export function addAuthStateListener(listener: AuthStateChangeListener): boolean;
export function removeAuthStateListener(listener: AuthStateChangeListener): boolean;
export function hasAuthStateListener(listener: AuthStateChangeListener): boolean;
export function getCurrentUser(): Promise<User>;

// FCM
export function addOnMessageReceivedCallback(onMessageReceived: (data: Message) => void): Promise<any>;
Expand Down
2 changes: 1 addition & 1 deletion firebase.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ firebase.getCurrentUser = function (arg) {
email: user.email,
emailVerified: user.emailVerified,
name: user.displayName,
refreshToken: user.refreshToken,
refreshToken: user.refreshToken
});
} else {
reject();
Expand Down

0 comments on commit aeaf670

Please sign in to comment.