isBcryptHash returns true when s already looks like a bcrypt hash so we do not double-hash a value that was round-tripped through the API.
(s string)
| 119 | // isBcryptHash returns true when s already looks like a bcrypt hash so we do |
| 120 | // not double-hash a value that was round-tripped through the API. |
| 121 | func isBcryptHash(s string) bool { |
| 122 | return len(s) > 4 && (s[:4] == "$2a$" || s[:4] == "$2b$") |
| 123 | } |
| 124 | |
| 125 | // POST /admin/api/v1/users |
| 126 | func apiV1CreateUser(w http.ResponseWriter, r *http.Request) { |