mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
0a970aef8a
This moves the OpenID Connect storage from memory into the SQL storage, making it persistent and allowing it to be used with clustered deployments like the rest of Authelia.
21 lines
472 B
Go
21 lines
472 B
Go
package oidc
|
|
|
|
import (
|
|
"context"
|
|
"crypto/subtle"
|
|
)
|
|
|
|
// Compare compares the hash with the data and returns an error if they don't match.
|
|
func (h PlainTextHasher) Compare(_ context.Context, hash, data []byte) (err error) {
|
|
if subtle.ConstantTimeCompare(hash, data) == 0 {
|
|
return errPasswordsDoNotMatch
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// Hash creates a new hash from data.
|
|
func (h PlainTextHasher) Hash(_ context.Context, data []byte) (hash []byte, err error) {
|
|
return data, nil
|
|
}
|