mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 03:44:34 +03:00
151ify, elaborate facebook and slack drivers
This commit is contained in:
parent
886890d1f8
commit
b4f2a6d24b
@ -8,15 +8,17 @@
|
||||
::
|
||||
=+ [`/com/facebook/www /dialog/oauth response-type/%code ~]
|
||||
=+ aut=(oauth2 - /'v2.3'/oauth/'access_token')
|
||||
|_ [bal=(bale keys.aut) access-token=token.aut]
|
||||
|_ {bal/(bale keys.aut) access-token/token.aut}
|
||||
++ auth ~(. aut bal /'user_about_me'/'user_posts')
|
||||
++ out (out-quay:auth 'access_token'^access-token)
|
||||
++ out (out-quay:auth key='access_token' value=access-token)
|
||||
++ in in-code:auth
|
||||
++ bak
|
||||
%- (bak-parse:auth . access-token.aut expires-in.aut ~)
|
||||
|= [access-token=@t expires-in=@u]
|
||||
|= {access-token/@t expires-in/@u}
|
||||
?: (lth expires-in ^~((div ~d7 ~s1))) :: short-lived token
|
||||
(toke-req:auth 'fb_exchange_token' fb-exchange-token/access-token ~)
|
||||
%^ toke-req:auth grant-type='fb_exchange_token'
|
||||
[key='fb_exchange_token' value=access-token]
|
||||
~
|
||||
[[%redo ~] ..bak(access-token access-token)]
|
||||
::++ wyp ~
|
||||
--
|
||||
|
@ -7,9 +7,9 @@
|
||||
::::
|
||||
::
|
||||
=+ aut=(oauth2 [`/com/slack /oauth/authorize ~] /api/'oauth.access')
|
||||
|_ [(bale keys:oauth2) tok=token.aut]
|
||||
|_ {(bale keys:oauth2) tok/token.aut}
|
||||
++ aut ~(. ^aut +<- /client/admin)
|
||||
++ out (out-quay:aut 'token'^tok)
|
||||
++ in in-code:aut
|
||||
++ bak (bak-save-access:aut . |=(tok=token:aut +>(tok tok)))
|
||||
++ bak (bak-save-access:aut . |=(tok/token:aut +>(tok tok)))
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user