New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@fluido/react-profile-manager

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluido/react-profile-manager

Fluido profile manager

  • 3.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fluido Provedor de Autenticação

Consiste num provedor de React para abstração do FirebaseAuth

Modo de usar

Exemplo de provedor

import ProfileProvider from '@fluido/react-profile-manager'

function App() {
  return (
    <ProfileProvider
      firebaseApp={FirebaseApp}
      pathname={currentRoute}
      refreshTokenTime={currentRoute}
      FCMKey={FirebaseCloudMessageKey}
      onCallRedirectToPublic={function handlePathnameUnauthorized() {}}
      onCallRedirectToAuthenticated={function handlePathnameAuthorizedBlock() {}}
      unauthenticatedRoutes={['/', '/home', '/login']}
      authenticatedRoutes={['/dashboard']}>
      <YourRoutes>...</YourRoutes>
    </ProfileProvider>
  )
}

Exemplo do hook

import { useProfile } from '@fluido/react-profile-manager'

function MyComponent() {
  const { ready, logged, user, token, FCMToken, FCMState, claims } =
    userProfile()

  return <div></div>
}

Especificação das propriedades do provedor

ParâmetrodefaultTipoDescrição
firebaseAppundefinedFirebaseAppaplicativo firebase inicializado
refreshTokenTime20numbertempo em segundos que o token será atualizado
pathnameundefinedstringcaminho URL para comparação das rotas autenticadas e não autenticadas
FCMKeyundefinedstringchave para o Firebase Cloud Message
onCallRedirectToPublicundefined() => {}função é chamada quando pathname está incluso na lista authenticatedRoutes
onCallRedirectToAuthenticatedundefined() => {}função é chamada quando pathname está incluso na lista unauthenticatedRoutes
unauthenticatedRoutes['/login']string[]lista de caminhos que chama a função onCallRedirectToAuthenticated com o usuário já autenticado
authenticatedRoutes[]string[]lista de caminhos que chama a função onCallRedirectToPublic sem usuário autenticado

Especificação das propriedades do hook

ParâmetroTipoDescrição
readybooleantrue se o FirebaseAuth já carregou os dados do usuário
loggedbooleantrue se o usuário está autenticado
userFirebaseUserdados do usuário autenticado
tokenstringtoken de acesso do usuário
FCMTokenstringtoken identificador do FCM Z
FCMState'loading' | 'ready' | 'require' | 'error'estado em que se encontra o FCM
claimsstring | string[]dados do usuário armazenado no FirebaseFirestore

Keywords

FAQs

Package last updated on 03 Sep 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc