rs / rest-layer

REST Layer, Go (golang) REST API framework
http://rest-layer.io
MIT License
1.26k stars 114 forks source link

Fix schema.VerifyPassword type assertion #248

Closed markostojanovic087 closed 3 years ago

markostojanovic087 commented 5 years ago

Fixing issue Issue-243

markostojanovic087 commented 5 years ago

I think now that examples provided will fail since they have this code:

{ID: "admin", Updated: time.Now(), ETag: "abcd", Payload: map[string]interface{}{
            "id":       "admin",
            "name":     "Dilbert",
            "password": secret,
        }},

As you can see the password isn't quoted. I think we should change it also. @smyrman Do you agreee?

By the way, there is another mistake in this examples which makes some of it's code useless.

Please see the line. The correct line will be

if *err != nil {

The way it is, the code always returns. @smyrman Should we open another issue or make this change along with this one?

smyrman commented 5 years ago

@smyrman Should we open another issue or make this change along with this one?

Maybe we can do a separate PR to update any issues in the example / README, then this can be merged sooner.

smyrman commented 3 years ago

Closing due to lack of activity.