Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
3ab31bfb
Commit
3ab31bfb
authored
Feb 03, 2018
by
Sietse Ringers
Browse files
Simplify code
parent
c80f2f6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
irmaclient/session.go
View file @
3ab31bfb
...
...
@@ -170,18 +170,11 @@ func (session *session) panicFailure() {
}
}
func
parseSigrequestJSON
(
sigrequestJSONString
string
)
(
*
irma
.
SignatureRequest
,
error
)
{
sigrequestJSON
:=
[]
byte
(
sigrequestJSONString
)
sigrequest
:=
&
irma
.
SignatureRequest
{}
err
:=
json
.
Unmarshal
(
sigrequestJSON
,
sigrequest
)
return
sigrequest
,
err
}
// Start a manual session
// NewManualSession starts a manual session, given a signature request in JSON and a handler to pass messages to
func
(
client
*
Client
)
NewManualSession
(
sigrequestJSONString
string
,
handler
Handler
)
{
sigrequest
,
err
:=
parseSigrequestJSON
(
sigrequestJSONString
)
if
err
!=
nil
{
var
err
error
sigrequest
:=
&
irma
.
SignatureRequest
{}
if
err
=
json
.
Unmarshal
([]
byte
(
sigrequestJSONString
),
sigrequest
);
err
!=
nil
{
handler
.
Failure
(
irma
.
ActionUnknown
,
&
irma
.
SessionError
{
Err
:
err
})
return
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment