Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(): npm whoami #5

Merged
merged 1 commit into from
May 3, 2017
Merged

feat(): npm whoami #5

merged 1 commit into from
May 3, 2017

Conversation

Izak88
Copy link
Contributor

@Izak88 Izak88 commented May 3, 2017

#3

@@ -106,6 +106,10 @@ export function publishPackage(req: auth.AuthRequest, res: express.Response): vo
});
}

export function whoami(req: auth.AuthRequest, res: express.Response): express.Response {
return res.status(200).json({ "username": res.locals.remote_user.name });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how could this work? where do we store remote_user.name in res.locals? not sure but I believe you need to work here with tokens...

Copy link
Contributor Author

@Izak88 Izak88 May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My other way to do that was with a token.
In auth.ts there is a function middleware, where we set remote_user propertie.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, forgot about auth.ts where this is already solved. merging.

@jkuri jkuri merged commit 0120695 into bleenco:master May 3, 2017
@Izak88 Izak88 deleted the whoami branch May 4, 2017 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants