sealcode / sealious

An extensible, declarative node framework
25 stars 2 forks source link

Problem with creating new user with the same username #229

Closed arkadiusz-wieczorek closed 8 years ago

arkadiusz-wieczorek commented 8 years ago

I've noticed issue, we can create new user with the same username indefinitely (tingo & mongo). Probably method Sealious.Dispatcher.users.user_exists doesn't work.

15:18:31.388 - info: User pi has been created
15:18:31.404 - info:    POST /api/v1/users
            from: 127.0.0.1, mime: multipart/form-data
            result: success!
15:18:32.032 - info: User pi has been created
15:18:32.035 - info:    POST /api/v1/users
            from: 127.0.0.1, mime: multipart/form-data
            result: success!
15:18:32.533 - info: User pi has been created
15:18:32.537 - info:    POST /api/v1/users
            from: 127.0.0.1, mime: multipart/form-data
            result: success!
15:18:32.961 - info: User pi has been created
15:18:32.969 - info:    POST /api/v1/users
            from: 127.0.0.1, mime: multipart/form-data
            result: success!
arkadiusz-wieczorek commented 8 years ago

The problem still exists on mongo & tingo.

arkadiusz-wieczorek commented 8 years ago

I've discovered that after creating two users with the same name and other passwords, they are others users.

kuba-orlik commented 8 years ago

Yes, currently UserManager leaves a lot to be desired. It'll be fixed when we remove it... :) On Nov 20, 2015 5:24 PM, "Arkadiusz Wieczorek" notifications@github.com wrote:

I've discovered that after creating two users with the same name and other passwords, they are others users.

— Reply to this email directly or view it on GitHub https://github.com/Sealious/sealious/issues/229#issuecomment-158450157.

adwydman commented 8 years ago

Yeah, UserManager, nobody likes you, Sealious will be better off without you!

W dniu piątek, 20 listopada 2015 Kuba Orlik notifications@github.com napisał(a):

Yes, currently UserManager leaves a lot to be desired. It'll be fixed when we remove it... :) On Nov 20, 2015 5:24 PM, "Arkadiusz Wieczorek" <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I've discovered that after creating two users with the same name and other passwords, they are others users.

— Reply to this email directly or view it on GitHub <https://github.com/Sealious/sealious/issues/229#issuecomment-158450157 .

— Reply to this email directly or view it on GitHub https://github.com/Sealious/sealious/issues/229#issuecomment-158452033.

kuba-orlik commented 8 years ago

A month later: "Come back, we love you! :<" On Nov 20, 2015 6:14 PM, "theadimar21" notifications@github.com wrote:

Yeah, UserManager, nobody likes you, Sealious will be better off without you!

W dniu piątek, 20 listopada 2015 Kuba Orlik notifications@github.com napisał(a):

Yes, currently UserManager leaves a lot to be desired. It'll be fixed when we remove it... :) On Nov 20, 2015 5:24 PM, "Arkadiusz Wieczorek" <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

I've discovered that after creating two users with the same name and other passwords, they are others users.

— Reply to this email directly or view it on GitHub < https://github.com/Sealious/sealious/issues/229#issuecomment-158450157 .

— Reply to this email directly or view it on GitHub <https://github.com/Sealious/sealious/issues/229#issuecomment-158452033 .

— Reply to this email directly or view it on GitHub https://github.com/Sealious/sealious/issues/229#issuecomment-158463363.

arkadiusz-wieczorek commented 8 years ago

A month later - UserManager says: "I would like to be DispatcherManager"

kuba-orlik commented 8 years ago

A year from now DispatcherManager becomes ResourceFieldTypeStructureReferenceSubjectType

It's good we have a clear outlook for the future :) On Nov 20, 2015 6:18 PM, "Arkadiusz Wieczorek" notifications@github.com wrote:

A month later - UserManager says: "I would like to be DispatcherManager"

— Reply to this email directly or view it on GitHub https://github.com/Sealious/sealious/issues/229#issuecomment-158464265.

arkadiusz-wieczorek commented 8 years ago

It makes sense, especially all functions which in name have "Type". :)

kuba-orlik commented 8 years ago

The future looks bright! On Nov 20, 2015 6:28 PM, "Arkadiusz Wieczorek" notifications@github.com wrote:

It makes sense, especially all functions which in name have "Type". :)

— Reply to this email directly or view it on GitHub https://github.com/Sealious/sealious/issues/229#issuecomment-158466540.

modliszka commented 8 years ago

If I can disturb such a lovely conversation... ^^ For me works when I change in user_exists:

        Sealious.Dispatcher.resources.find({
                username: username
            }, "user")

To:

        Sealious.Dispatcher.resources.find(
            context, {
                username: username
            }, "user")

The dispatcher's find function needs 3 arguments, not 2.

arkadiusz-wieczorek commented 8 years ago

Yep, it's correctly solution, probably nobody added context to this method after introduction of Context feature to Sealious.

arkadiusz-wieczorek commented 8 years ago

https://github.com/Sealious/sealious/pull/247

adwydman commented 8 years ago

Merged.