Skip to content

Hello every one , I need help to rest the Pin for my token , and I have ( SO ) pin. #142

@Elsayed-Mubarak

Description

@Elsayed-Mubarak
    let { soPin, newPin } = req.body
    /**
     * @desc — USING FIRST SLOT
     *
     */
    mode = mod
    var slot = mode.getSlots(0)
    /**
     *
     * @desc — PREPARE SESSION TO OPEN && ADD PERMISSION RW_SESSION
     */

    if (slot.flags & graphene.SlotFlag.TOKEN_PRESENT) {
      session = slot.open(
        graphene.SessionFlag.RW_SESSION | graphene.SessionFlag.SERIAL_SESSION,
      )
      console.log(' err ........................')
    }
    /**
     *
     * @desc — OPEN SESSION WITH TOKEN USING PIN AND USER TYPE `USER`
     */

    console.log(' type of ...........', typeof soPin)
    console.log(' type of ...........', typeof newPin)

    session.login(soPin, graphene.UserType.SO)

    session.setPin(soPin, newPin)
   // session.getObject()
    console.log(' session.getObject() ..........', session.getObject())

    // session.logout()

    session.close()

    mode.finalize()

    return res.status(200).json({ message: 'pin is changed ...' })

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions