Socket
Book a DemoInstallSign in
Socket

volkeno-react-native-auth

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

volkeno-react-native-auth

a react native complete autehetification by volkeno

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

This project is a authentication page with built-in buttons

This package is currently only maintained for Expo managed React Native projects, support for bare React Native projects is coming soon

Installation

Add the dependency:

npm i volkeno-react-native-auth

or

yarn add volkeno-react-native-auth

Login

Peer Dependencies

IMPORTANT! You need install them.
 "react": "^16.0.0-beta.5",
 "react-native": "^0.49.1"

Basic Usage

First step: import the component:

import { Login } from "volkeno-react-native-auth";

Second step: Use the login

export default function App() {
  const [showPassword, setShowPassword] = React.useState(false);
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <Login
        showPassword={showPassword}
        setShowPassword={setShowPassword}
        email={email}
        setEmail={setEmail}
        password={password}
        setPassword={setPassword}
        errors={errors}
        setErrors={setErrors}
        title={"Login"}
        forgotPasswordText={"Mot de passe oublié ?"}
        OnSubmit={submit}
        textRedirectRegisterStyle={{ color: "red" }}
      />
    </View>
  );
}

Here we have a function which reacts when the connect button is clicked. showPassword and setShowPassword allows you to activate or deactivate the visibility of the password.

email and setEmail allows you to enter and modify the email variable when typing it.

password and setPassword are used to enter and modify the password variable when typed.

the variables errors and setErrors are mandatory. They allow you to display errors when validating the email and password

Configuration - Props

Props require

PropertyTypeDefaultDescription
showPasswordbooleanfalseActivate to see the password
setShowPasswordfunctionvoidCalled for allows you to activate or deactivate the visibility of the password.
emailstring-Enter email address
setEmailfunctionvoidCalled for allows you to enter and modify the email variable when typing it.
passwordstring-Enter Password
setPasswordfunctionvoidUsed to enter and modify the password variable when typed.
errorsobjectvoidObject used to store email and password validation errors
setErrorsfunctionvoidThey allow you to display errors when validating the email and password
OnSubmitfunctionvoidFunction that reacts when the connect button is clicked.

Other props

PropertyTypeDefaultDescription
titlestring"Connexion"change connection text
forgotPasswordTextstring-Put a forgotten password text
pressForgotPasswordfunctionvoidhandle forgotPasswordText button is pressed
colorIconPasswordcolor"#2FCA74"eye color
textConnexionstring"SE CONNECTER"change text on login button
leftIconPasswordfunctionvoidput a key icon 🔑 for the password
leftIconEmailfunctionvoidput a mail icon 📧 for the email address
textRedirectRegisterstring-Allow to put a text which will make it possible to make a redirection towards the page of registration
pressRedirectRegisterfunctionvoidhandle textRedirectRegister button is pressed

Styles props

PropertyTypeDefaultDescription
stylesstyle{flex: 1, paddingHorizontal: 20}modify or replace the default style of the entire page
textRedirectRegisterStylestyle{ color: "#2FCA74",textAlign: "center",fontSize: 14 }change or override the default styling for textRedirectRegister
connexionButtonStylestyle{backgroundColor: "#2FCA74",height: 50,minWidth: "100%",paddingHorizontal: 25}modify or replace the default style of the connexion button
connexionTitleStylestyle{color: "white",fontWeight: "bold",letterSpacing: 1,ontSize: 14}change or override the default styling for login text
titleStylestyle{marginVertical: 30,fontWeight: "bold",color: "#454545",fontSize: 36,textAlign: "center",change or override the default styling for connexion text
forgotPasswordTextStylestyle{ color: "#454545" }hange or override the default styling forgotPasswordText
export default function App() {
  const [showPassword, setShowPassword] = React.useState(false);
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <Login
        OnSubmit={submit}
        pressForgotPassword={() => {
          Alert.alert("change passWord");
        }}
        pressRedirectRegister={() => {
          Alert.alert("redirect regidter");
        }}
        showPassword={showPassword}
        setShowPassword={setShowPassword}
        email={email}
        setEmail={setEmail}
        password={password}
        setPassword={setPassword}
        errors={errors}
        setErrors={setErrors}
        title={"Login"}
        forgotPasswordText={"Mot de passe oublié ?"}
        forgotPasswordTextStyle={{
          color: "red",
          textAlign: "center",
        }}
        titleStyle={{
          color: "red",
          marginVertical: 30,
          fontWeight: "bold",
          fontSize: 36,
          textAlign: "center",
        }}
        textConnexion={"Je me connect"}
        leftIconPassword={
          <Icon name="ios-lock-open-outline" size={20} color={Colors.bgApp2} />
        }
        leftIconEmail={
          <Icon name="mail-outline" size={20} color={Colors.bgApp2} />
        }
        textRedirectRegisterStyle={{ color: "red" }}
        textRedirectRegister="Je n'ai pas encore de compte"
        styles={{}}
      />
    </View>
  );
}

Social props

PropertyTypeDefaultDescription
facebookbooleanfalseActivate to see the facebook button
googlebooleanfalseActivate to see the google button
registerSocialSubmitfunctionvoidFunction that reacts when one of the social media buttons is clicked
facebookAppIdstring-this is the AppId for Facebook. It is obligatory
iosClientIdstring-this is the iosClientId for Google. It is obligatory
androidClientIdstring-this is the androidClientId for Google. It is obligatory
iosStandaloneAppClientIdstring-this is the iosStandaloneAppClientId for Google. It is obligatory
androidStandaloneAppClientIdstring-this is the androidStandaloneAppClientId for Google. It is obligatory

Register

Peer Dependencies

IMPORTANT! You need install them.
 "react": "^16.0.0-beta.5",
 "react-native": "^0.49.1"

Basic Usage

First step: import the component:

import { Register } from "volkeno-react-native-auth";

Second step: Use the register

export default function App() {
  const [showPassword, setShowPassword] = React.useState(false);
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [password_confirmation, setPassword_confirmation] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <Register
        OnSubmit={submit}
        setShowPassword={setShowPassword}
        showPassword={showPassword}
        email={email}
        setEmail={setEmail}
        password={password}
        setPassword={setPassword}
        password_confirmation={password_confirmation}
        setPassword_confirmation={setPassword_confirmation}
        errors={errors}
        setErrors={setErrors}
        textRedirectLogin="Je n'ai pas encore de compte"
      />
    </View>
  );
}

Here we have a function which reacts when the connect button is clicked. showPassword and setShowPassword allows you to activate or deactivate the visibility of the password.

email and setEmail allows you to enter and modify the email variable when typing it.

password and setPassword are used to enter and modify the password variable when typed.

the variables errors and setErrors are mandatory. They allow you to display errors when validating the email and password

Configuration - Props

Props require

PropertyTypeDefaultDescription
showPasswordbooleanfalseActivate to see the password
setShowPasswordfunctionvoidCalled for allows you to activate or deactivate the visibility of the password.
emailstring-Enter email address
setEmailfunctionvoidCalled for allows you to enter and modify the email variable when typing it.
passwordstring-Enter password
setPasswordfunctionvoidUsed to enter and modify the password variable when typed.
password_confirmationstring-Enter Password Confirmation
setPassword_confirmationfunctionvoidUsed to enter and modify the Password Confirmation variable when typed.
errorsobjectvoidObject used to store email and password validation errors
setErrorsfunctionvoidThey allow you to display errors when validating the email and password
OnSubmitfunctionvoidFunction that reacts when the registration button is clicked.

Other props

PropertyTypeDefaultDescription
titlestring"Connexion"change connection text
colorIconPasswordcolor"#2FCA74"eye color
textButtonRegisterstring"S'inscrire"change text on register button
leftIconPasswordfunctionvoidput a key icon 🔑 for the password
leftIconEmailfunctionvoidput a mail icon 📧 for the email address
leftIconFirstNamefunctionvoidput an icon at firstName
leftIconLastNamefunctionvoidput an icon at lastName
leftIconAdressefunctionvoidput an icon at adresse
leftIconPhonefunctionvoidput a phone icon 📞 for phone
textRedirectLoginstring"Je suis déjà inscrit"Allow to put a text which will make it possible to make a redirection towards the page of connection
pressRedirectLoginfunctionvoidhandle textRedirectLogin button is pressed
first_namestringfalseenter first_name if it exists
last_namestringfalseenter last_name if it exists
phonestringfalseenter phone if it exists
adressestringfalseenter adresse if it exists
setFirstNamefunctionvoidCalled for allows you to enter and modify the first_name variable when typing it
setLastNamefunctionvoidCalled for allows you to enter and modify the last_name variable when typing it
setPhonefunctionvoidCalled for allows you to enter and modify the phone variable when typing it
setAdressefunctionvoidCalled for allows you to enter and modify the adresse variable when typing it
labelEmailstring"Adresse mail"Change the Email label
labelPasswordstring"Mot de Passe"Change the password label
labelPassword_confirmationstring"Confirmer mot de passe"Change the Password Confirmation label
labelFirstNamestring"Prénom"Change the first_name label if first_name exists
labelLastNamestring"Nom"Change the last_name label if last_name exists
labelPhonestring"Téléphone"Change the phone label if phone exists
labelAdressestring"Adresse"Change the adresse label if adresse exists

Styles props

PropertyTypeDefaultDescription
stylesstyle{flex: 1, paddingHorizontal: 20}modify or replace the default style of the entire page
textRedirectLoginStylestyle{ color: "#2FCA74",textAlign: "center",fontSize: 14 }change or override the default styling for textRedirectLogin
connexionButtonStylestyle{backgroundColor: "#2FCA74",height: 50,minWidth: "100%",paddingHorizontal: 25}modify or replace the default style of the connexion button
connexionTitleStylestyle{color: "white",fontWeight: "bold",letterSpacing: 1,ontSize: 14}change or override the default styling for login text
titleStylestyle{marginVertical: 30,fontWeight: "bold",color: "#454545",fontSize: 36,textAlign: "center",change or override the default styling for connexion text

Social props

PropertyTypeDefaultDescription
facebookbooleanfalseActivate to see the facebook button
googlebooleanfalseActivate to see the google button
registerSocialSubmitfunctionvoidFunction that reacts when one of the social media buttons is clicked
facebookAppIdstring-this is the AppId for Facebook. It is obligatory
iosClientIdstring-this is the iosClientId for Google. It is obligatory
androidClientIdstring-this is the androidClientId for Google. It is obligatory
iosStandaloneAppClientIdstring-this is the iosStandaloneAppClientId for Google. It is obligatory
androidStandaloneAppClientIdstring-this is the androidStandaloneAppClientId for Google. It is obligatory

Forgot Password

Peer Dependencies

IMPORTANT! You need install them.
 "react": "^16.0.0-beta.5",
 "react-native": "^0.49.1"

Basic Usage

First step: import the component:

import { RequestPasswordReset } from "volkeno-react-native-auth";

Second step: Use the RequestPasswordReset

export default function App() {
  const [email, setEmail] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <RequestPasswordReset
        OnSubmit={submit}
        email={email}
        setEmail={setEmail}
        errors={errors}
        setErrors={setErrors}
      />
    </View>
  );
}

Props require

PropertyTypeDefaultDescription
emailstring-Enter email address
setEmailfunctionvoidCalled for allows you to enter and modify the email variable when typing it.
errorsobjectvoidObject used to store email and password validation errors
setErrorsfunctionvoidThey allow you to display errors when validating the email and password
OnSubmitfunctionvoidFunction that reacts when the registration button is clicked.

Other props

PropertyTypeDefaultDescription
titlestring"Veuillez entrer votre email Nous vous enverrons un lien pour modifier le mot de passe"change connection text
leftIconEmailfunctionvoidput a mail icon 📧 for the email address
textRedirectLoginstring"Je suis déjà inscrit"Allow to put a text which will make it possible to make a redirection towards the page of connection
pressRedirectLoginfunctionvoidhandle textRedirectLogin button is pressed
labelEmailstring"Adresse mail"Change the Email label
textValidatestring"Valider"change text on validate button

Styles props

PropertyTypeDefaultDescription
stylesstyle{flex: 1, paddingHorizontal: 20}modify or replace the default style of the entire page
textRedirectLoginStylestyle{ color: "#2FCA74",textAlign: "center",fontSize: 14 }change or override the default styling for textRedirectLogin
connexionButtonStylestyle{backgroundColor: "#2FCA74",height: 50,minWidth: "100%",paddingHorizontal: 25}modify or replace the default style of the connexion button
connexionTitleStylestyle{color: "white",fontWeight: "bold",letterSpacing: 1,ontSize: 14}change or override the default styling for login text
titleStylestyle{marginVertical: 30,fontWeight: "bold",color: "#454545",fontSize: 36,textAlign: "center",change or override the default styling for connexion text

after that you can use ResetPassword

ResetPassword

Peer Dependencies

IMPORTANT! You need install them.
 "react": "^16.0.0-beta.5",
 "react-native": "^0.49.1"

Basic Usage

First step: import the component:

import { Login } from "volkeno-react-native-auth";

Second step: Use the login

export default function App() {
  const [email, setEmail] = React.useState("");
  const [code, setCode] = React.useState("");
  const [password, setPassword] = React.useState("");
  const [confrimPassword, setConfrimPassword] = React.useState("");
  const [errors, setErrors] = React.useState({});

  const submit = async () => {
    Alert.alert("Félicitation", "Connexion réussie");
  };

  return (
    <View style={styles.container}>
      <ResetPassword
        OnSubmit={submit}
        email={email}
        setEmail={setEmail}
        code={code}
        setCode={setCode}
        password={password}
        setPassword={setPassword}
        confrimPassword={confrimPassword}
        setConfrimPassword={setConfrimPassword}
        errors={errors}
        setErrors={setErrors}
      />
    </View>
  );
}

Props require

PropertyTypeDefaultDescription
showPasswordbooleanfalseActivate to see the password
setShowPasswordfunctionvoidCalled for allows you to activate or deactivate the visibility of the password.
emailstring-Enter email address
setEmailfunctionvoidCalled for allows you to enter and modify the email variable when typing it.
codestring-Enter the code you received
setCodefunctionvoidCalled for allows you to enter and modify the code variable when typing it.
passwordstring-Enter Password
setPasswordfunctionvoidUsed to enter and modify the password variable when typed.
confrimPasswordstring-Enter Password Confirmation
setPasswordfunctionvoidUsed to enter and modify the password variable when typed.
setConfrimPasswordfunctionvoidUsed to enter and modify the password Confirmation variable when typed.
errorsobjectvoidObject used to store email and password validation errors
setErrorsfunctionvoidThey allow you to display errors when validating the email and password
OnSubmitfunctionvoidFunction that reacts when the connect button is clicked.

Other props

PropertyTypeDefaultDescription
titlestring"Veuillez entrer votre code puis modifier votre mot de passe"change connection text
colorIconPasswordcolor"#2FCA74"eye color
textValidatestring"Valider"change text on validate button
leftIconPasswordfunctionvoidput a key icon 🔑 for the password
leftIconEmailfunctionvoidput a mail icon 📧 for the email address
leftIconCodefunctionvoidput a icon for the code
labelCodestring"Code"Change the Code label
labelEmailstring"Adresse mail"Change the Email label
labelPasswordstring"Nouveau Mot de Passe"Change the password label
labelConfrimPasswordstring"Confirmer Nouveau Mot de Passe"Change the Password Confirmation label

Styles props

PropertyTypeDefaultDescription
stylesstyle{flex: 1, paddingHorizontal: 20}modify or replace the default style of the entire page
connexionButtonStylestyle{backgroundColor: "#2FCA74",height: 50,minWidth: "100%",paddingHorizontal: 25}modify or replace the default style of the connexion button
connexionTitleStylestyle{color: "white",fontWeight: "bold",letterSpacing: 1,ontSize: 14}change or override the default styling for login text
titleStylestyle{marginVertical: 30,fontWeight: "bold",color: "#454545",fontSize: 36,textAlign: "center",change or override the default styling for connexion text

Keywords

react-native

FAQs

Package last updated on 29 Mar 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.