sahat / satellizer

Token-based AngularJS Authentication
https://satellizer-sahat.rhcloud.com
MIT License
7.86k stars 1.13k forks source link

Extra request in Implicit Grant #839

Open nass600 opened 8 years ago

nass600 commented 8 years ago

Hello there!.

I am not sure if this was intentionally removed for the $digest problem but since this commit: [https://github.com/sahat/satellizer/commit/76ba026870c0734ba54fa55bb23402f7d9c70e60#diff-b46a46a3cc318dfd3675ebfb08790a6eR533] the implicit grant is performing an extra request (the exchange token request via url config param) when using Implicit Grant instead of just resolve and return the token.

vincentius commented 8 years ago

I modified line 723 of the source of Satellizer 0.15.4 to this: (responseType.indexOf('token ') != -1 || responseType.indexOf(' token') != -1 || responseType === 'token' || !url)

Like this the second request won't be made if the responseType contains 'token', because I use responseType: 'id_token token'.

bhtz commented 7 years ago

Same issue for me and vincentius solution perfectly work for me too ! +1