1.0.11 • Published 2 years ago

@davse/users_manager v1.0.11

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

UsersApp

User account management.

Requirements

  1. Have typeorm and postgresql installed.
  2. Configure .env file.

Functions

  • singIn function (req, res, repository, wsession) Description: This function is for user authentication and session initialization.
  • singUp function (req, res, repository, user) Description: This function is to create a user account.
  • updateUser function (req, res, repository) Description: This function is to update user account information.
  • logOut function (req, res) Description: This function is to exit the session.
  • currentUser function (req, res, repository) Description: This function returns session information for the current user.
  • authenticateMail function (req, res, repository) Description: This function is to authenticate the user's mail account.
  • resetPassword function (req, res, repository) Description: This function finds the user account with the confirmation code generated by the forgotPasswordMail function and resets the user account password.
  • forgotPasswordMail function (req, res, repository) Description: This function generates a confirmation code, associates it with the user account, and sends an email to reset the user account password.

Function variables

-repository is the user repository. -user is an instance of the user entity. -wsession true/false if it implements 'express-session'. Expected structure:

@Entity()
export class Users {

    @PrimaryGeneratedColumn()
    id: number;

    @PrimaryColumn("varchar", { length: 200 })
    mail: string;

    @Column("varchar", { length: 60 })
    userName: string;    

    @Column("varchar", { length: 500 })
    password: string;

    @Column("varchar", { length: 15, default: null})
    mobilePhone: string;

    @Column({default: false})
    verifiedAcount: boolean;

    @Column("date")
    creationDate: Date;

    @Column("varchar",{default: null})
    imgURL: string;

    @Column("varchar",{ length: 200 })
    confirmationCode: string; 
} 

Implementation example : https://github.com/davserc/testUserApp

1.0.11

2 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago