rise-auth-foundation
v0.0.3
Published
## Install
Downloads
7
Readme
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)
}