0.0.3 • Published 1 year ago

rise-auth-foundation v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Rise Auth Foundation

Install

npm i rise-auth-foundation

Usage

createPasswordHash

import { createPasswordHash } from 'rise-auth-foundation'
const hash = createPasswordHash('12341234')

validatePassword

import { validatePassword } from 'rise-auth-foundation'
const isValid = validatePassword('12341234', hash)

makeSessionId

import { makeSessionId } from 'rise-auth-foundation'
const sessionId = makeSessionId()

setCookieHttpResponse

import { setCookieHttpResponse } from 'rise-auth-foundation'
export const handler = async () => {
    const sessionId = '123...'
    return setCookieHttpResponse(sessionId)
}

getSessionCookieFromApiEvent

import { getSessionCookieFromApiEvent } from 'rise-auth-foundation'
export const handler = async (e) => {
    const sessionId = getSessionCookieFromApiEvent(e)
}
0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago