Function
redirectWithAuthKey
({
redirectUri,
authApiKey,
userId,
state,
}: {
redirectUri: URL;
authApiKey: string;
userId: User.UserId;
state: Option.Option<string>;
})
Source from the content-addressed store, hash-verified
| 166 | }; |
| 167 | |
| 168 | const redirectWithAuthKey = ({ |
| 169 | redirectUri, |
| 170 | authApiKey, |
| 171 | userId, |
| 172 | state, |
| 173 | }: { |
| 174 | redirectUri: URL; |
| 175 | authApiKey: string; |
| 176 | userId: User.UserId; |
| 177 | state: Option.Option<string>; |
| 178 | }) => { |
| 179 | const params = new URLSearchParams({ |
| 180 | authApiKey, |
| 181 | userId, |
| 182 | }); |
| 183 | |
| 184 | if (Option.isSome(state)) { |
| 185 | params.set("state", state.value); |
| 186 | } |
| 187 | |
| 188 | redirectUri.hash = params.toString(); |
| 189 | return HttpServerResponse.redirect(redirectUri); |
| 190 | }; |
| 191 | |
| 192 | const getBearerAuthKey = Effect.gen(function* () { |
| 193 | const headers = yield* HttpServerRequest.schemaHeaders( |
Tested by
no test coverage detected