Skip to content
This repository was archived by the owner on Mar 22, 2022. It is now read-only.

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

Merged
daffl merged 1 commit into
feathersjs-ecosystem:masterfrom
mcnamee:master
Aug 31, 2016
Merged

daffl merged 1 commit into
feathersjs-ecosystem:masterfrom
mcnamee:master

Conversation

@mcnamee

@mcnamee mcnamee commented Aug 23, 2016

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Member

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

mcnamee commented Aug 24, 2016

Copy link
Copy Markdown
Contributor Author

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

@mcnamee

mcnamee commented Aug 28, 2016

Copy link
Copy Markdown
Contributor Author

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

daffl commented Aug 28, 2016

Copy link
Copy Markdown
Member

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

mcnamee commented Aug 28, 2016

Copy link
Copy Markdown
Contributor Author

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

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

daffl commented Aug 31, 2016

Copy link
Copy Markdown
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants