action didn't check for external Idp ID
I add an action to log info out
here is my code
and I add a flow in picture
but log is output just this
but then I remove this line
log output have
you can see [RAY] is log in message
let logger = require("zitadel/log")
function lineOauthAutofill(ctx , api){
if (ctx.v1.externalUser.externalIdpId != "280262665769582647") {
return
}
logger.log('[RAY] Hello this function is running')
logger.log('[RAY] id is '+ ctx.v1.externalUser.externalIdpId)
logger.log('Line ProviderInfo: ' + JSON.stringify(ctx.v1.providerInfo));
}
let logger = require("zitadel/log")
function lineOauthAutofill(ctx , api){
if (ctx.v1.externalUser.externalIdpId != "280262665769582647") {
return
}
logger.log('[RAY] Hello this function is running')
logger.log('[RAY] id is '+ ctx.v1.externalUser.externalIdpId)
logger.log('Line ProviderInfo: ' + JSON.stringify(ctx.v1.providerInfo));
}
time="2024-09-18T10:05:16Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:05:16.726923797Z\",\"took\":0,\"message\":\"action run started\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:05:16Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:05:16.727790594Z\",\"took\":866797,\"message\":\"action run succeeded\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:05:16Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:05:16.726923797Z\",\"took\":0,\"message\":\"action run started\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:05:16Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:05:16.727790594Z\",\"took\":866797,\"message\":\"action run succeeded\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
if (ctx.v1.externalUser.externalIdpId != "280262665769582647") {
return
}
if (ctx.v1.externalUser.externalIdpId != "280262665769582647") {
return
}
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.129208814Z\",\"took\":0,\"message\":\"action run started\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130209759Z\",\"took\":0,\"message\":\"[RAY] Hello this function is running\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130333127Z\",\"took\":0,\"message\":\"[RAY] id is 285470657381138487\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130920048Z\",\"took\":0,\"message\":\"Line ProviderInfo: {\\\"rawInfo\\\":info",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.131074837Z\",\"took\":1866053,\"message\":\"action run failed: could not convert [object Promise] to error\",\"logLevel\":\"error\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.129208814Z\",\"took\":0,\"message\":\"action run started\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130209759Z\",\"took\":0,\"message\":\"[RAY] Hello this function is running\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130333127Z\",\"took\":0,\"message\":\"[RAY] id is 285470657381138487\",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.130920048Z\",\"took\":0,\"message\":\"Line ProviderInfo: {\\\"rawInfo\\\":info",\"logLevel\":\"info\",\"instanceId\":\"280262665769582647\"}"
time="2024-09-18T10:03:05Z" level=info msg="log record emitted" caller="/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19" record="{\"logDate\":\"2024-09-18T10:03:05.131074837Z\",\"took\":1866053,\"message\":\"action run failed: could not convert [object Promise] to error\",\"logLevel\":\"error\",\"instanceId\":\"280262665769582647\"}"

6 Replies
nvm i figured it out
Sorry for my late reply, would you mind sharing the solution?
Might help others. 😄
I does notthing
wait for next day
and try again
somehow it work lmao i don't know what cause it
maybe the function name?
I change it to mapLineOauth both name and funtion name
now it look like this


haha, anyway thanks for sharing 😄