0.21.0 • Published 2 years ago

@cloverbyte/auth v0.21.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Cloverbyte Auth

This library is developed for Angular applications with Firebase authentication.

Dependencies

  • @angular/common 14.1.3+
  • @angular/core": 14.1.3+
  • @angular/fire 7.4.1+
  • @ngxs/store 3.7.5+
  • firebase 9.9.2+
  • rxfire 6.0.3+

Install

npm install @cloverbyte/auth

Setup

import { CloverbyteAuthModule } from '@cloverbyte/auth';

@NgModule({
  imports: [
    ...
    ...
    // import angular/fire initializers
    provideFirebaseApp(() => initializeApp(environment.firebase)),
    provideFirestore(() => getFirestore()),
    provideAuth(() => {
      console.log('PROVIDE AUTH');

      if (Capacitor.isNativePlatform()) {
        console.log('isNativePlatform');

        return initializeAuth(getApp(), {
          persistence: indexedDBLocalPersistence,
        });

        // return initializeAuth(getApp());
      } else {
        console.log('NOT a native platform');

        return getAuth();
      }
    }),

    // import CloverbyteAuthModule
    CloverbyteAuthModule.forRoot({
      apiUrl: 'SAMPLE_URL',
      loginNavigationPath: '<path to destination after login>',
      logoutNavigationPath: '<path to destination after logout>',
      defaultPhotoUrl: '<path to default profile photo>',
      useFirestoreUserPersistence: true,
    }),

    // import state management
    NgxsModule.forRoot([
      ...
      AuthState,
      UserState,
      ...
    ]),
    ...
    ...
  ],
  bootstrap: [App],
  declarations: [App],
})
class AppModule {}

API

User

MethodDescription
findById
updateUserInfo
updateUserPhoto
create
delete

Auth

MethodDescription
setAuth
login
logout
getToken
signUp
sendPasswordResetEmail
resetPassword
sendVerificationEmail
0.21.0

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.10.0

2 years ago

0.2.0

2 years ago

0.11.0

2 years ago

0.9.0

2 years ago

0.12.0

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.5.0

2 years ago

0.16.0

2 years ago

0.4.0

2 years ago

0.17.0

2 years ago

0.7.0

2 years ago

0.18.0

2 years ago

0.6.0

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago