Socket
Socket
Sign inDemoInstall

@cloverbyte/auth

Package Overview
Dependencies
1
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cloverbyte/auth

An angular library


Version published
Maintainers
1
Created

Readme

Source

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

Keywords

FAQs

Last updated on 18 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc