Skip to content

Package for elm that checks a password agians the public API of haveibeenpwned.com

License

Notifications You must be signed in to change notification settings

brasilikum/is-password-known

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Is this password known?

This elm package checks a given password against the API of haveibeenpwned.com.

Usage

requestPassword: String -> Cmd Msg
requestPassword pass =
    pass
        |> hashAndCut
        |> Debug.log "This will be sent to HaveIBeenPawned.com"
        |> requestPossibleMatches
        |> Http.send PasswordResponse
update msg model =
    case msg of
        SetPassword pass ->
            ( { model | password = pass }, Cmd.none )

        CheckPassword ->
            ( model, requestPassword model.password )

        PasswordResponse (Ok resp) ->
                    ( { model
                        | isPasswordKnown =
                            Just (isPasswordKnown model.password resp)
                    }
                    , Cmd.none
                    )

About

Package for elm that checks a password agians the public API of haveibeenpwned.com

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages