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

Manually supply an endpoint to the Client authenticate() method #278

Merged
merged 1 commit into from Aug 31, 2016

Conversation

Projects
None yet
3 participants
@mcnamee
Copy link
Contributor

mcnamee commented Aug 23, 2016

By simply providing the ability to specify the endpoint in the client authenticate method, it allows the ability for mobile users to authenticate via a native mobile Facebook SDK for example, and then post that Facebook access_token to Feathers to do it's thing via the FacebookTokenStrategy method.

eg. from react-native, I've just authenticated natively via the Facebook SDK, which has given me an access token:

app.authenticate({
   type: 'token',
   endpoint: '/auth/facebook',
   access_token: accessToken
});
@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Aug 23, 2016

This looks good to me. Do you mind making a PR for the docs and we can merge them both at the same time?

@mcnamee

This comment has been minimized.

Copy link
Contributor Author

mcnamee commented Aug 24, 2016

No problem @marshallswain - I've just submitted a PR. Hope it's ok :)

@mcnamee

This comment has been minimized.

Copy link
Contributor Author

mcnamee commented Aug 28, 2016

I've also added a catch for when an auth error occurs. Without this update, the script always continues as successful regardless of whether an error occurred. Now the client can show an error message etc.

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Aug 28, 2016

I think this looks great, thank you @mcnamee! Looks like JSHint is failing on CI at the moment (src/client/index.js: line 54, col 8, Missing semicolon.).

@mcnamee

This comment has been minimized.

Copy link
Contributor Author

mcnamee commented Aug 28, 2016

@daffl - sorry for wasting your time, I should have tested sooner!

@daffl daffl merged commit 490de3f into feathersjs:master Aug 31, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@daffl

This comment has been minimized.

Copy link
Member

daffl commented Aug 31, 2016

No worries. Thanks a lot for the PR! Released in 0.7.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.