MCPcopy Create free account
hub / github.com/comaps/comaps / FindAuthenticityToken

Function FindAuthenticityToken

tools/python/oauth2-flow/oauth2_flow.py:188–195  ·  view source on GitHub ↗
(formAction, htmlCode)

Source from the content-addressed store, hash-verified

186
187
188def FindAuthenticityToken(formAction, htmlCode):
189 # search for <form action="(...)" ... <input name="authenticity_token" value="(...)">
190 regex = re.compile(r'action="(.+?)".*?name="authenticity_token" value="(.+?)"')
191 matches = regex.findall(htmlCode)
192
193 for action, token in matches:
194 if action == formAction:
195 return token
196
197
198def FindOauthCode(redirectUri):

Callers 2

FetchSessionIdFunction · 0.70
FetchRequestTokenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected