mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-13 08:38:43 +03:00
finally working google auth flow; do not delete!
This commit is contained in:
parent
0e3a28ea5c
commit
6268b5f6aa
@ -24,6 +24,7 @@
|
||||
++ grab-json
|
||||
|* [a=httr b=fist:jo]
|
||||
~| bad-json/r.a
|
||||
~| (poja q:(need r.a))
|
||||
(need (;~(biff poja b) q:(need r.a)))
|
||||
--
|
||||
::
|
||||
|
@ -22,21 +22,25 @@
|
||||
response-type/%code
|
||||
==
|
||||
--
|
||||
::
|
||||
!:
|
||||
::::
|
||||
::
|
||||
|_ [bal=(bale keys:oauth2) user-state]
|
||||
++ auth-re ~(. (re:auth .) ref |=(a=_ref +>(ref a)))
|
||||
++ auth ~(. (auth-usr usr.bal) bal (scopes 'userinfo.email' 'plus.me' ~))
|
||||
++ auth ~(. (auth-usr usr.bal) bal ~&((scopes 'userinfo.email' 'plus.me' ~) (scopes 'userinfo.email' 'plus.me' ~)))
|
||||
++ scopes
|
||||
=+ scope=|=(b=@ta (endpoint:oauth2 dom.bal /auth/[b]))
|
||||
|=(a=(list ,@ta) (turn a |=(b=@ta (crip (earn (scope b))))))
|
||||
|=(a=(list ,@ta) ['https://mail.google.com' (turn a |=(b=@ta (crip (earn (scope b)))))])
|
||||
::
|
||||
++ out (out-fix-expired:auth-re (out-math:auth ber))
|
||||
++ res (res-handle-refreshed:auth-re save-access res-give:auth)
|
||||
++ res |=(a=httr ~&(a ((res-handle-refreshed:auth-re save-access res-give:auth) a)))
|
||||
++ save-access |=(a=cord:[token:oauth2] +>(ber a))
|
||||
::
|
||||
++ in in-code:auth
|
||||
++ bak (bak-save-tokens:auth-re save-access)
|
||||
:: ++ upd *user-state
|
||||
++ in
|
||||
|= a=quay
|
||||
~& got-quay/a
|
||||
(in-code:auth a)
|
||||
++ bak |=(a=httr ~&(bak/a ((bak-save-tokens:auth-re save-access) a)))
|
||||
++ upd *user-state
|
||||
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user